1

I am converting an older C# Website Project into a Web Application Project so that we can better manage it in our source control system. I have run into a problem.

The Website Project used strongly-typed-datasets (i.e. .XSD files). There is C# code written that uses these strongly typed datasets as an object. That worked fine when it was a Website Project but does NOT compile now that it is a Web Application project. The compiler can not find the reference to the datas set because datasets are not compiled.

Is there an easy solution to this problem?

4

3 に答える 3

2

コマンド ラインで XSD.exe を使用して、データセット クラスをクラス ファイルに生成し、そのファイルを新しいプロジェクトに追加できます。

xsd.exe StronglyTypedDataset.xsd /dataset

これにより、ファイル "StronglyTypedDataset.cs" が生成されます。/namespace:My.Project.Namespaceデータセット クラスを特定の名前空間に配置する必要がある場合 は、フラグを使用します。

これは基本的に、Web サイト プロジェクトの舞台裏で行われていることです。

于 2009-09-08T20:05:34.347 に答える
1

XSDコンパイラをVisualStudio(2003-2010)に統合するための優れたガイドがあります。プロセスの自動化に役立つ場合があります:http ://wiki.codesynthesis.com/Using_XSD_with_Microsoft_Visual_Studio#Visual_Studio_2010_.2810.0.29

于 2011-02-28T21:59:04.523 に答える
0

Webアプリケーションプロジェクトに変換するときにうまくいったもう1つのアプローチは、プロジェクトから.xsdファイルを削除して、再度含めることでした。

VS 2008は、使用する「カスタムツール」プロパティ(MSDataSetGenerator)を自動的に定義し、xsdが変更されるたびに*.designer.csファイルを再作成します。

于 2011-03-01T00:40:13.620 に答える