【发布时间】:2021-02-03 07:24:12
【问题描述】:
我正在尝试在两个 Visual Studio VB.NET 项目之间复制数据源。我已经确定,如果我将这些文件从源项目复制到目标项目:
- ClassDiagram1.cd
- DataSet1.Designer.vb
- DataSet1.vb
- DataSet1.xsc
- DataSet1.xsd
- 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