Share .cs file among VS 2010 C# projects

筅森魡賤 提交于 2019-12-31 04:34:13

问题


I was wondering if two separate C# Windows projects (in two separate solutions) can share one .cs file with shared definitions? If so, then how?

PS. One project is ASP.NET web app and the second project is C# Windows service (started as a Windows console project.)


回答1:


Add Existing Item->Add As Link (found by selecting drop down on Add button)




回答2:


Move that cs file/code to be shared to a new class library project and refer that in your other 2 projects.



来源:https://stackoverflow.com/questions/15907467/share-cs-file-among-vs-2010-c-sharp-projects

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!