【问题标题】:Copy Data Source From Between Visual Studio Projects从 Visual Studio 项目之间复制数据源
【发布时间】:2021-02-03 07:24:12
【问题描述】:

我正在尝试在两个 Visual Studio VB.NET 项目之间复制数据源。我已经确定,如果我将这些文件从源项目复制到目标项目:

  1. ClassDiagram1.cd
  2. DataSet1.Designer.vb
  3. DataSet1.vb
  4. DataSet1.xsc
  5. DataSet1.xsd
  6. DataSet1.xss

然后将以下所有条目从源 .vbproj 复制到目标 .vbproj 文件中的正确位置(使用文本编辑器,而不是 VS):

<Compile Include="DataSet1.Designer.vb">
  <AutoGen>True</AutoGen>
  <DesignTime>True</DesignTime>
  <DependentUpon>DataSet1.xsd</DependentUpon>
</Compile>
<Compile Include="DataSet1.vb">
  <DependentUpon>DataSet1.xsd</DependentUpon>
</Compile>

<None Include="DataSet1.xsc">
  <DependentUpon>DataSet1.xsd</DependentUpon>
</None>
<None Include="DataSet1.xsd">
  <SubType>Designer</SubType>
  <Generator>MSDataSetGenerator</Generator>
  <LastGenOutput>DataSet1.Designer.vb</LastGenOutput>
</None>
<None Include="DataSet1.xss">
  <DependentUpon>DataSet1.xsd</DependentUpon>
</None>

下次在 VS 中打开目标项目时,数据源会神奇地出现。我的问题是:没有更简单的方法吗?!?!?!你会认为你可以导入 .xsd 文件或其他东西,但这似乎不是一个选项。

【问题讨论】:

  • 如果项目在同一个解决方案中,那么您应该能够在解决方案资源管理器中将DataSet 项目从一个拖动到另一个。如果它们在不同的解决方案中,那么您应该能够使用 Add > Exiting Item 并且只需选择顶级项目(我认为是 XSD),VS 将把其余的带到一起。
  • 绝对是 .XSD。那简直太容易了。你想把它作为答案,这样我才能接受。

标签: vb.net visual-studio


【解决方案1】:

如果项目在同一个解决方案中,那么您应该能够在解决方案资源管理器中将DataSet 项目从一个拖到另一个。如果它们在不同的解决方案中,那么您应该能够使用 Add > Existing Item 并只需选择顶级项目(XSD 文件),VS 将带上其余的。 p>

【讨论】:

    猜你喜欢
    • 2010-10-26
    • 2011-09-18
    • 2015-08-13
    • 1970-01-01
    • 2010-10-13
    • 2017-08-29
    • 2012-01-12
    • 2011-03-07
    • 1970-01-01
    相关资源
    最近更新 更多