简体   繁体   中英

Unable to reference new C# class library project

Background

I am working on a reasonably large legacy ASP.NET MVC solution.

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).

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.

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.

在此处输入图片说明

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM