.NETFramework,Version = v4.5框架是比当前目标框架".NETFramework,Version = v3.5"更高的版本

Jid*_*jan 8 .net c# asp.net frameworks

我在Framework 3.5中创建了我的第一个项目,并且我转换为框架4.5并且它完美地工作.其次,我尝试将此项目的引用添加到在框架4.5中创建的另一个项目.在添加引用后构建我的第二个项目时,我收到一条错误消息:

1. The primary reference "xxx" could not be resolved because it was built against the ".NETFramework,Version=v4.5" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v3.5".
2. The type or namespace name 'xxx' could not be found (are you missing a using directive or an assembly reference?)
Run Code Online (Sandbox Code Playgroud)

请告诉我遗失的地方

小智 0

您的第二个项目似乎不针对 .net 4.5 框架。您可以右键单击第二个项目并转到“属性”->“应用程序”。

它会说目标框架是 3.5,将其更改为 4.5,并确保您的第一个项目也是如此