我已将我的 blazor 客户端项目项目从 preview7 更新到 preview 8,使用 Visual Studio 2019 运行。
我已按照此处详述的说明进行操作;
.NET Core 3.0 Preview 8 中的 ASP.NET Core 和 Blazor 更新
但是,当我构建解决方案时,会出现以下错误;
IL Linker 5> 5> Unhandled Exception: Mono.Linker.Steps.XmlResolutionException: Failed to process XML description: ---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'Microsoft.AspNetCore.Mvc.Core,版本=3.0.0.0,文化=中性,PublicKeyToken=adb9793829ddae60' ---> Mono.Cecil.AssemblyResolutionException:无法解析程序集:'Microsoft.AspNetCore.Mvc.Core,版本=3.0.0.0,文化=中性,PublicKeyToken= adb9793829ddae60' 5> 在 Mono.Linker.DirectoryAssemblyResolver.Resolve(AssemblyNameReference 名称,ReaderParameters 参数) 5> 在 Mono.Linker.AssemblyResolver.Resolve(AssemblyNameReference 名称,ReaderParameters 参数) 5> 在 Mono.Linker.LinkContext.Resolve(IMetadataScope 范围) 5>--- 内部异常堆栈跟踪结束 --- 5> 在 Mono.Linker.LinkContext.Resolve(IMetadataScope 范围) 5> 在 Mono.Linker.LinkContext.ResolveReferences(AssemblyDefinition 程序集) 5> 在 Mono.Linker.Steps.ResolveFromXmlStep .ProcessAssemblies(LinkContext context, XPathNodeIterator iterator) 5> 在 Mono.Linker.Steps.ResolveFromXmlStep.Process() 5> --- 内部异常堆栈跟踪结束 --- 5> 在 Mono.Linker.Steps.ResolveFromXmlStep.Process( ) 5> 在 Mono.Linker.Steps.BaseStep.Process(LinkContext context) 5> 在 Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep 步骤) 5>ProcessAssemblies(LinkContext context, XPathNodeIterator iterator) 5> 在 Mono.Linker.Steps.ResolveFromXmlStep.Process() 5> --- 内部异常堆栈跟踪结束 --- 5> 在 Mono.Linker.Steps.ResolveFromXmlStep.Process() 5> 在 Mono.Linker.Steps.BaseStep.Process(LinkContext context) 5> 在 Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep 步骤) 5>ProcessAssemblies(LinkContext context, XPathNodeIterator iterator) 5> 在 Mono.Linker.Steps.ResolveFromXmlStep.Process() 5> --- 内部异常堆栈跟踪结束 --- 5> 在 Mono.Linker.Steps.ResolveFromXmlStep.Process() 5> 在 Mono.Linker.Steps.BaseStep.Process(LinkContext context) 5> 在 Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep 步骤) 5>
在 Mono.Linker.Pipeline.Process(LinkContext context) 5> 在 Mono.Linker.Driver.Run(ILogger customLogger) 5> 在 Mono.Linker.Driver.Execute(String[] args, ILogger customLogger) 5>
在 Mono.Linker.Driver.Main(String[] args) 5>C:\Users\matt.nuget\packages\microsoft.aspnetcore.blazor.build\3.0.0-preview8.19405.7\targets\Blazor.MonoRuntime.targets (441,5):错误 MSB3073:命令“dotnet”C:\Users\matt.nuget\packages\microsoft.aspnetcore.blazor.mono\3.0.0-preview8.19380.1\build\netstandard1.0../。 ./tools/illink/illink.dll" -l none --disable-opt unreachablebodies --verbose --strip-security true --exclude-feature com --exclude-feature sre -v false -c link -u link - b true -d "C:\Users\matt.nuget\packages\microsoft.aspnetcore.blazor.mono\3.0.0-preview8.19380.1\build\netstandard1.0../../tools/mono/bcl/" -d "C:\Users\matt.nuget\packages\microsoft.aspnetcore.blazor.mono\3.0.0-preview8.19380.1\build\netstandard1.0../../tools/mono/bcl/Facades/" -o "C:\Users\matt\Source\Repos\OakfieldLeasing\OakfieldLeasing.Blazor.Client\obj\Debug\netcoreapp3.0\blazor\linker/" -x "C:\Users\matt.nuget\packages\microsoft.aspnetcore.blazor。 build\3.0.0-preview8.19405.7\targets\BuiltInBclLinkerDescriptor.xml" -x "C:\Users\matt\Source\Repos\OakfieldLeasing\OakfieldLeasing.Blazor.Client\obj\Debug\netcoreapp3.0\blazor\linker.描述符.xml" -a "C:\Users\matt.nuget\packages\blazored.localstorage\2.0.12\lib\netstandard2.0\Blazored.LocalStorage.dll" -a "C:\Users\matt.nuget\ packages\microsoft.aspnetcore.blazor\3.0.0-preview8.19405.7\lib\netstandard2.0\Microsoft.AspNetCore.Blazor.dll”-a “C:\Users\matt.nuget\packages\microsoft.aspnetcore.blazor. httpclient\3.0.0-preview8.19405.7\lib\netstandard2.0\Microsoft.AspNetCore.Blazor.HttpClient.dll" -a "C:\Users\matt.nuget\packages\mono.webassembly.interop\3.0.0-preview8.19405.4\lib\netstandard2.0\Mono.WebAssembly.Interop.dll" -a "C:\Users\matt.nuget\packages \newtonsoft.json\12.0.3-beta1\lib\netstandard2.0\Newtonsoft.Json.dll" -a "C:\Users\matt\Source\Repos\OakfieldLeasing\OakfieldLeasing.Blazor.Shared\bin\Debug\netstandard2 .1\OakfieldLeasing.Blazor.Shared.dll" -a "C:\Users\matt\Source\Repos\OakfieldLeasing\OakfieldLeasing.Blazor.Client\obj\Debug\netcoreapp3.0\OakfieldLeasing.Blazor.Client.dll""退出代码 -532462766。\Users\matt\Source\Repos\OakfieldLeasing\OakfieldLeasing.Blazor.Shared\bin\Debug\netstandard2.1\OakfieldLeasing.Blazor.Shared.dll" -a "C:\Users\matt\Source\Repos\OakfieldLeasing\OakfieldLeasing .Blazor.Client\obj\Debug\netcoreapp3.0\OakfieldLeasing.Blazor.Client.dll"" 退出,代码为 -532462766。\Users\matt\Source\Repos\OakfieldLeasing\OakfieldLeasing.Blazor.Shared\bin\Debug\netstandard2.1\OakfieldLeasing.Blazor.Shared.dll" -a "C:\Users\matt\Source\Repos\OakfieldLeasing\OakfieldLeasing .Blazor.Client\obj\Debug\netcoreapp3.0\OakfieldLeasing.Blazor.Client.dll"" 退出,代码为 -532462766。
Blazor 客户端项目引用的唯一其他项目是引用.Net Standard 2.1
.
我在 Blazor 客户端项目的依赖项 -> 分析器中列出了以下内容。
最后我.csproj
的是
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<OutputType>Exe</OutputType>
<LangVersion>7.3</LangVersion>
<RazorLangVersion>3.0</RazorLangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<OutputPath></OutputPath>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Blazored.LocalStorage" Version="2.0.12" />
<PackageReference Include="Microsoft.AspNetCore.Blazor" Version="3.0.0-preview8.19405.7" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="3.0.0-preview8.19405.7" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.HttpClient" Version="3.0.0-preview8.19405.7" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3-beta1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OakfieldLeasing.Blazor.Shared\OakfieldLeasing.Blazor.Shared.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="wwwroot\images\" />
</ItemGroup>
</Project>
我也尝试过Newtonsoft.Json
用Microsoft.AspNetCore.NewtonsoftJson
Nuget 包替换,但这似乎没有什么区别。
请问有人知道是什么原因造成的吗?