[英].NETCore 3.1 - Error MC1000 Unknown build error, 'Could not find assembly 'System.Web, Version=4.0.0.0
Using Visual Studio 16.6, migrating WPF app to target .netcore3.1(.300).使用 Visual Studio 16.6,将 WPF 应用程序迁移到目标 .netcore3.1(.300)。 Cannot compile with error below:无法编译并出现以下错误:
Error MC1000 Unknown build error, 'Could not find assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.错误 MC1000 未知的构建错误,'找不到程序集'System.Web,版本 = 4.0.0.0,文化 = 中性,PublicKeyToken = b03f5f7f11d50a3a'。 Either explicitly load this assembly using a method such as LoadFromAssemblyPath() or use a MetadataAssemblyResolver that returns a valid assembly.'要么使用 LoadFromAssemblyPath() 等方法显式加载此程序集,要么使用返回有效程序集的 MetadataAssemblyResolver。 MyApp C:\Program Files\dotnet\sdk\3.1.300\Sdks\Microsoft.NET.Sdk.WindowsDesktop\targets\Microsoft.WinFX.targets 225 MyApp C:\Program Files\dotnet\sdk\3.1.300\Sdks\Microsoft.NET.Sdk.WindowsDesktop\targets\Microsoft.WinFX.targets 225
I don't seem to have any need or reference for System.Web我似乎对 System.Web 没有任何需求或参考
I see similar things here but am on current versions: https://github.com/dotnet/wpf/issues/2648我在这里看到类似的东西,但在当前版本上: https://github.com/dotnet/wpf/issues/2648
Any ideas?有任何想法吗?
There seemed to be an issue with the structure of the project file.项目文件的结构似乎存在问题。 I don't reference System.Web but a third party DevExpress component does.我没有引用 System.Web 但第三方 DevExpress 组件可以。
When you target .netcoreapp31 AND net472, the Nuget packages do not seem to get pointed to the target frameworks correctly.当您以 .netcoreapp31 和 net472 为目标时,Nuget 包似乎没有正确指向目标框架。 The project file needed to be manually restructured to point them to the correct frameworks.需要手动重组项目文件以将它们指向正确的框架。
Details here: Issue on github dotnet/wpf详细信息: github dotnet/wpf 上的问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.