[英]How can I use a namespace from ASP.Net 5 MVC preview template project?
In Microsoft Visual Studio 2015 I have two projects: the first is created on the basis of ASP.NET 5 Preview templates (Web Application), the second is Unit Test project. 在Microsoft Visual Studio 2015中,我有两个项目:第一个是基于ASP.NET 5 Preview模板(Web应用程序)创建的,第二个是单元测试项目。 In order to test some methods in the first project, I want to add a reference to it in my TestProject.
为了测试第一个项目中的某些方法,我想在我的TestProject中添加对它的引用。 However, I get an error "A reference to "MVCProject" could not be added".
但是,出现错误“无法添加对“ MVCProject”的引用”。 How can I resolve this problem?
我该如何解决这个问题?
UPD: Target platform for TestProject is .NET 4.5.2 (I tried also swith to .NET 4.6, didn't get any difference in terms of my question). UPD:TestProject的目标平台是.NET 4.5.2(我也尝试过使用.NET 4.6,在我的问题上没有任何区别)。 In MVCProject I find only the following info: Solution DNX SDK Version: Version=1.0.0 beta5, Platform= .NET Framework, Architecture=x86 - and that's all.
在MVCProject中,我仅找到以下信息:解决方案DNX SDK版本:Version = 1.0.0 beta5,Platform = .NET Framework,Architecture = x86-仅此而已。
for asp.net 5 you should not add "Test Projects", instead you add a class library package project for testing with xunit. 对于asp.net 5,您不应添加“测试项目”,而应添加用于使用xunit测试的类库包项目。 this article should help you
本文应该对您有帮助
then you should have no problem adding a reference 那么您添加参考应该没有问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.