[英]Unable to reference new C# class library project
Background 背景
I am working on a reasonably large legacy ASP.NET MVC solution. 我正在研究一个相当大的遗留ASP.NET MVC解决方案。
Currently all of the code resides in just two projects (one containing model first C# generated code, the other containing the rest of the application). 当前,所有代码仅驻留在两个项目中(一个包含模型第一个C#生成的代码,另一个包含应用程序的其余部分)。
Problem 问题
I've added 2 projects to the solution - one for unit tests & one containing some code to be used as a service by the web application. 我已经在解决方案中添加了2个项目-一个用于单元测试,另一个包含要由Web应用程序用作服务的代码。
When I reference the service project from the main project there's a yellow warning sign by the reference. 当我从主项目引用服务项目时,引用旁边会显示一个黄色警告标志。
As I said this is a legacy project with code all over the place & I'm not sure why this is happening. 正如我说的那样,这是一个遍历整个代码的遗留项目,我不确定为什么会这样。
I've tried Googling for a solution but haven't been able to find anything that gives some clues to this problem... 我尝试使用谷歌搜索解决方案,但找不到任何可以为该问题提供线索的东西...
Note: There are just two classes in the service project 注意:服务项目中只有两个类
Here's a picture of the warning: 这是警告的图片:
Make sure that both projects are set to the same version of the .NET Framework. 确保两个项目都设置为相同版本的.NET Framework。
For example if your Main project targets to .NET Framework 4.0 and your Services project targets to .NET Framework 4.5.2, you can expect some compatibility issues. 例如,如果您的Main项目针对.NET Framework 4.0,而Services项目针对.NET Framework 4.5.2,则可能会遇到一些兼容性问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.