Is it possible to reference a VS2005 website project from another project in the same solution?

拥有回忆 提交于 2019-12-12 16:58:19

问题


I'd like to add nunit testing to a VS2005 C# ASP.NET website project - so that I can excercise methods in the App_Code directory. It's recommended that the tests are added as a seperate assembly so that the testing code does not get delivered with the website - in this lies my question:

When I add a new project into the solution which holds the website and try to add a reference to the website project it does not show up in the projects tab - is it possible to reference a website project from another project (without having to convert the website project into a web application project)?


回答1:


I would recommend you to extract the classes you have in your App_Code folder and place them in a separate project. Reference that new project in your web project. You will now have a better separation of your projects and classes, and can unit test your classes separately.



来源:https://stackoverflow.com/questions/995099/is-it-possible-to-reference-a-vs2005-website-project-from-another-project-in-the

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