VS Code Omnisharp.MsBuild.Projectmanager 无法加载程序集 System.Numerics.Vectors 4.1.3.0 [英] VS Code Omnisharp.MsBuild.Projectmanager can not load assembly System.Numerics.Vectors 4.1.3.0

查看:20
本文介绍了VS Code Omnisharp.MsBuild.Projectmanager 无法加载程序集 System.Numerics.Vectors 4.1.3.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在打开新创建的 blazorwasm 项目时遇到问题.Omnisharp 将无法正确启动.这是输出:

I'm having a problem with opening a newly created blazorwasm project. Omnisharp will not start correctly. This is the output:

[warn]: OmniSharp.MSBuild.ProjectManager Failed to load project file 'c:\VS.NET2010\CoreApp\Server\CoreApp.Server.csproj'.
c:\VS.NET2010\CoreApp\Server\CoreApp.Server.csproj(1,1)
System.IO.FileLoadException: Kan bestand of assembly System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a of een van de afhankelijkheden hiervan niet laden. De manifestdefinitie van de gevonden assembly komt niet overeen met de assembly-verwijzing. (Uitzondering van HRESULT: 0x80131040)
Bestandsnaam: System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
   bij System.SpanHelpers.IndexOf(Char& searchSpace, Char value, Int32 length)
   bij Microsoft.Build.Evaluation.Expander`2.Function`1.ExtractPropertyFunction(String expressionFunction, IElementLocation elementLocation, Object propertyValue, UsedUninitializedProperties usedUnInitializedProperties, IFileSystem fileSystem)
   bij Microsoft.Build.Evaluation.Expander`2.PropertyExpander`1.ExpandPropertyBody(String propertyBody, Object propertyValue, IPropertyProvider`1 properties, ExpanderOptions options, IElementLocation elementLocation, UsedUninitializedProperties usedUninitializedProperties, IFileSystem fileSystem)
   bij Microsoft.Build.Evaluation.Expander`2.PropertyExpander`1.ExpandPropertiesLeaveTypedAndEscaped(String expression, IPropertyProvider`1 properties, ExpanderOptions options, IElementLocation elementLocation, UsedUninitializedProperties usedUninitializedProperties, IFileSystem fileSystem)
   bij Microsoft.Build.Evaluation.Expander`2.PropertyExpander`1.ExpandPropertiesLeaveEscaped(String expression, IPropertyProvider`1 properties, ExpanderOptions options, IElementLocation elementLocation, UsedUninitializedProperties usedUninitializedProperties, IFileSystem fileSystem)
   bij Microsoft.Build.Evaluation.Expander`2.ExpandIntoStringLeaveEscaped(String expression, ExpanderOptions options, IElementLocation elementLocation)
   bij Microsoft.Build.Evaluation.ToolsetReader.ExpandPropertyUnescaped(ToolsetPropertyDefinition property, Expander`2 expander)
   bij Microsoft.Build.Evaluation.ToolsetReader.EvaluateAndSetProperty(ToolsetPropertyDefinition property, PropertyDictionary`1 properties, PropertyDictionary`1 globalProperties, PropertyDictionary`1 initialProperties, Boolean accumulateProperties, String& toolsPath, String& binPath, Expander`2& expander)
   bij Microsoft.Build.Evaluation.ToolsetReader.ReadToolset(ToolsetPropertyDefinition toolsVersion, PropertyDictionary`1 globalProperties, PropertyDictionary`1 initialProperties, Boolean accumulateProperties)
   bij Microsoft.Build.Evaluation.ToolsetReader.ReadEachToolset(Dictionary`2 toolsets, PropertyDictionary`1 globalProperties, PropertyDictionary`1 initialProperties, Boolean accumulateProperties)
   bij Microsoft.Build.Evaluation.ToolsetReader.ReadToolsets(Dictionary`2 toolsets, PropertyDictionary`1 globalProperties, PropertyDictionary`1 initialProperties, Boolean accumulateProperties, String& msBuildOverrideTasksPath, String& defaultOverrideToolsVersion)
   bij Microsoft.Build.Evaluation.ToolsetReader.ReadAllToolsets(Dictionary`2 toolsets, ToolsetRegistryReader registryReader, ToolsetConfigurationReader configurationReader, PropertyDictionary`1 environmentProperties, PropertyDictionary`1 globalProperties, ToolsetDefinitionLocations locations)
   bij Microsoft.Build.Evaluation.ProjectCollection.InitializeToolsetCollection(ToolsetRegistryReader registryReader, ToolsetConfigurationReader configReader)
   bij Microsoft.Build.Evaluation.ProjectCollection..ctor(IDictionary`2 globalProperties, IEnumerable`1 loggers, IEnumerable`1 remoteLoggers, ToolsetDefinitionLocations toolsetDefinitionLocations, Int32 maxNodeCount, Boolean onlyLogCriticalEvents, Boolean loadProjectsReadOnly)
   bij Microsoft.Build.Evaluation.ProjectCollection..ctor(IDictionary`2 globalProperties)
   bij OmniSharp.MSBuild.ProjectLoader.EvaluateProjectFileCore(String filePath) in D:\a\1\s\src\OmniSharp.MSBuild\ProjectLoader.cs:regel 123
   bij OmniSharp.MSBuild.ProjectLoader.BuildProject(String filePath) in D:\a\1\s\src\OmniSharp.MSBuild\ProjectLoader.cs:regel 72
   bij OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Load(String filePath, ProjectIdInfo projectIdInfo, ProjectLoader loader, Guid sessionId, IDotNetCliService dotNetCli) in D:\a\1\s\src\OmniSharp.MSBuild\ProjectFile\ProjectFileInfo.cs:regel 113
   bij OmniSharp.MSBuild.ProjectManager.<>c__DisplayClass31_0.<LoadProject>b__0() in D:\a\1\s\src\OmniSharp.MSBuild\ProjectManager.cs:regel 302
   bij OmniSharp.MSBuild.ProjectManager.LoadOrReloadProject(String projectFilePath, Func`1 loader) in D:\a\1\s\src\OmniSharp.MSBuild\ProjectManager.cs:regel 313

WRSCH: registratie van assembly-bindingen is uitgeschakeld.
Als u assembly-bindingsfouten wilt registreren, stelt u de registerwaarde [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) in op 1.
Opmerking: er is een prestatiestraf gekoppeld aan de registratie van assembly-bindingsfouten.
Als u deze functie wilt uitschakelen, verwijdert u de registerwaarde [HKLM\Software\Microsoft\Fusion!EnableLog].

这是 csproj 文件:

This is the csproj file:

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="3.2.0" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\Client\CoreApp.Client.csproj" />
    <ProjectReference Include="..\Shared\CoreApp.Shared.csproj" />
  </ItemGroup>
</Project>

我不知道为什么会出现此错误.因此,我无法在此项目中使用 IntelliSense.我的一个同事没有这个问题.他可以使用以下命令创建一个类似的项目:dotnet new blazorwasm -o CoreApp --hosted

I have no clue why I get this error. Due to this I am not able to use IntelliSense in this project. A colleague of mine does not have this problem. He can create a similar project with the command: dotnet new blazorwasm -o CoreApp --hosted

在他的 PC 上,项目打开得很好,没有任何 OmniSharp 警告.

On his PC the project opens just fine without any OmniSharp warning.

我不知道为什么我的电脑会出现这个错误.

I do not ave a clue why I get this error on my PC.

有人有想法吗?

提前致谢!

推荐答案

问题是 C# for Visual Studio Code (Powered by OmniSharp) VS Code Extension 中包含的 MSBuild 无法正确定位到具体的 4.1.3.0系统上 System.Numerics.Vectors 的版本.

The problem is that the included MSBuild in the C# for Visual Studio Code (powered by OmniSharp) VS Code Extension is not able to correctly locate the specific 4.1.3.0 version of System.Numerics.Vectors on the system.

最好的解决方案是在

C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Numerics.Vectors\v4.0_4.1.3.0__b03f5f7f11d50a3a

另一种解决方案是安装 .NET Core SDK 3.1.301,其中包含该版本的 System.Numerics.Vectors 程序集,然后复制

Another solution is to install .NET Core SDK 3.1.301 which contains that version of the System.Numerics.Vectors assembly and then copy

C:\Program Files\dotnet\sdk\3.1.301\Sdks\Microsoft.NET.Sdk.WindowsDesktop\tools\net472\System.Numerics.Vectors.dll

%USERPROFILE%\.vscode\extensions\ms-dotnettools.csharp-1.22.1\.omnisharp\1.35.3\.msbuild\Current\Bin

这个问题可能会在更高版本的 C# for Visual Studio Code(由 OmniSharp 提供支持)VS Code 扩展中得到解决

This issue will probably be resolved in a later version of the C# for Visual Studio Code (powered by OmniSharp) VS Code Extension

这篇关于VS Code Omnisharp.MsBuild.Projectmanager 无法加载程序集 System.Numerics.Vectors 4.1.3.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆