0

基本上,我需要使用项目 A 中的类和方法,项目 B 是一个 Windows 窗体应用程序,项目 B 是一个 ASP.net 网站项目(在 Visual Studio 2010 中使用 C#)。我不能简单地添加引用,因为这需要将表单应用程序转换为类库。我也不想将我需要的类和方法从项目 A 合并到项目 B 中。

这可能吗?

4

2 回答 2

3

将您的寡妇形成类及其方法放在类库中(制作新项目)。并在您的网络项目中作为参考

于 2012-06-04T10:17:52.170 回答
0

Basically what you need is a class library where you can put the classes which are used in both web app and windows app. See here on how to create a class library. Remember - the class library should not contain any web or windows specific code. Please read this up for the best practices.

于 2012-06-04T16:19:54.563 回答