当尝试使用最新的.net core 3.0预览版构建Blazor(托管)应用程序时,出现以下错误:
Error NU1107 Version conflict detected for Microsoft.CodeAnalysis.CSharp.Workspaces. Install/reference Microsoft.CodeAnalysis.CSharp.Workspaces 3.0.0 directly to project MyBlazorApp.Server to resolve this issue.
我试图通过直接安装软件包来解决此问题,但这也失败了:
Install-Package Microsoft.CodeAnalysis.CSharp.Workspaces -Version 3.0.0
错误:
Install-Package : NU1107: Version conflict detected for Microsoft.CodeAnalysis.Workspaces.Common. Install/reference Microsoft.CodeAnalysis.Workspaces.Common 3.0.0 directly to project MyBlazorApp.Server to
resolve this issue.
在每种情况下,我尝试安装控制台中推荐的软件包并收到类似的错误。我还尝试安装软件包的最新版本(而不是3.0.0)。
Blazor托管解决方案中的“服务器”项目中发生错误。这是我的.csproj文件的相关部分:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<RestoreAdditionalProjectSources>
https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json;
https://dotnet.myget.org/F/blazor-dev/api/v3/index.json;
</RestoreAdditionalProjectSources>
<LangVersion>7.3</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AutoMapper" Version="8.1.0" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="6.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.Server" Version="3.0.0-preview5-19227-01" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.0.0-preview5-19227-01" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.0.0-preview.18572.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="3.0.0-preview.18572.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.0.0-preview.18572.1" />
<PackageReference Include="Microsoft.NETCore.App" Version="3.0.0-preview-27122-01" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.0.0-preview5-19264-04" />
</ItemGroup>
在使用Net Core 3.0预览软件包版本时,如何解决这些nuget软件包冲突?