我在 Framework 3.5 中创建了我的第一个项目,然后我转换到 Framework 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?)
请给我一些我遗漏的地方的建议
您的第二个项目似乎不针对 .net 4.5 框架。您可以右键单击您的第二个项目并转到属性 -> 应用程序。
它会说目标框架是 3.5,将其更改为 4.5,并确保您的第一个项目也是如此