当我启动VS Code或重启OmniSharp时,会出现以下错误消息:
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /Users/user/Documents/repos/proj/proj-backend/Application/Application.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
Package Microsoft.EntityFrameworkCore.Analyzers, version 3.1.5 was not found. It might have been deleted since NuGet restore. Otherwise, NuGet restore might have only partially completed, which might have been due to maximum path length restrictions.
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file '/Users/user/Documents/repos/proj/proj-backend/Application/Application.csproj'.
/Users/user/Documents/repos/proj/proj-backend/Application/Application.csproj
/usr/local/share/dotnet/sdk/3.1.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(234,5): Error: Package Microsoft.EntityFrameworkCore.Analyzers, version 3.1.5 was not found. It might have been deleted since NuGet restore. Otherwise, NuGet restore might have only partially completed, which might have been due to maximum path length restrictions.
这是我的csproj文件:
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<ProjectReference Include="..\Persistence\Persistence.csproj"/>
<ProjectReference Include="..\Domain\Domain.csproj"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="MediatR" Version="8.0.0"/>
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="8.0.0"/>
<PackageReference Include="Newtonsoft.Json" Version="12.0.3"/>
<PackageReference Include="RestSharp" Version="106.10.1"/>
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="5.6.0"/>
<PackageReference Include="StandardModels" Version="0.1.3.15"/>
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="5.6.0"/>
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.5"/>
<PackageReference Include="EPPlus" Version="5.1.1"/>
<PackageReference Include="AutoMapper" Version="9.0.0"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Analyzers" Version="3.1.5"/>
</ItemGroup>
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
</Project>
dotnet restore --no-cache
命令正常工作,构建和运行没有错误。我尝试删除 Microsoft.EntityFrameworkCore.Analyzers 但没有任何改变。
有什么想法,为什么我无法加载它?
提前致谢!