我开始了一个新的 winforms 项目,相当简单,有一些标签、文本框和一个按钮。所有代码都运行良好。我忘记在创建应用程序之前将框架版本从 4(使用 VS 2010)更改为 3.5,当我将其更改为 3.5 或 3.5 客户端配置文件时,我收到以下警告:
The primary reference "Microsoft.CSharp", which is a framework assembly, could not be resolved in the currently targeted framework. ".NETFramework,Version=v3.5". To resolve this problem, either remove the reference "Microsoft.CSharp" or retarget your application to a framework version which contains "Microsoft.CSharp".
从一开始就使用 3.5 设置重新创建它并不是什么大问题,而且我相当确定我没有使用我需要的 4 框架中的任何东西。
最佳答案
在 VS 2010 for .NET 4 的大多数/所有项目模板中,添加了 Microsoft.CSharp
程序集引用。因此,当您创建项目时,您会自动获得此程序集引用。删除引用应该不会有任何问题。
关于c# - 主要引用 "Microsoft.CSharp"是框架程序集,无法在当前目标框架中解析,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4339004/