【发布时间】:2020-07-26 11:31:25
【问题描述】:
当我尝试打开以 .Net 3.5 为目标的现有项目或创建一个以它为目标的新项目时,Visual Studio 找不到一些 .Net Framework 程序集:
如您所见,System、System.Data、System.Drawing、System.Runtime.Serialization 和 System.Xml 未找到。
我在构建时遇到的错误类似于
Warning MSB3267 The primary reference "System", 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 "System" or retarget your application to a framework version which contains "System".
如果我将项目重新定位到 .Net v4.5 之类的东西,则可以找到所有程序集,但我需要它以 v3.5 作为目标进行构建。
我尝试解决的问题: 1) 我确保在 Windows 功能中启用了 .Net3.5:
2) 我确保在 Visual Studio 中安装了 3.5 开发工具:
3) 我尝试从microsoft installation file手动安装.Net v3.5
到目前为止,这些步骤都没有帮助。我尝试手动搜索这些丢失的 dll,并在 C:\Windows\Microsoft.NET\Framework 的各个子文件夹中找到它们,主要在 C:\Windows\Microsoft.NET\Framework\v2.0.50727 中。
解决此问题的正确方法是什么?如何将 VS 指向程序集?我的设置有问题吗?
软件版本: Visual Studio Community 2019 v16.53,Windows 10 Pro,有一些新更新
【问题讨论】:
-
也许你可以尝试在Developer Community报告问题
标签: c# visual-studio windows-10 .net-3.5