是否可以从同一解决方案中的另一个项目引用 VS2005 网站项目?
我想将 nunit 测试添加到 VS2005 C# ASP.NET 网站项目 - 以便我可以练习 App_Code 目录中的方法。 建议将测试作为单独的程序集添加,以便测试代码不会随网站一起交付 - 这就是我的问题:
当我将一个新项目添加到包含网站的解决方案中并尝试添加对网站项目没有显示在项目选项卡中 - 是否可以从另一个项目引用网站项目(无需将网站项目转换为 Web 应用程序项目)?
I'd like to add nunit testing to a VS2005 C# ASP.NET website project - so that I can exercise 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)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议您提取 App_Code 文件夹中的类并将它们放在一个单独的项目中。 在您的 Web 项目中引用该新项目。 现在,您可以更好地分离项目和类,并且可以单独对您的类进行单元测试。
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.