我收到此错误:enter code here
System.TypeLoadException:无法使用 typeref 中的标记 0100001a 解析类型(程序集"System.Runtime, Version=4.2.2.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a'中的预期类"System.Threading.Tasks.Task"(
当我切换到:
<TargetFramework>netcoreapp3.1</TargetFramework>
或
<TargetFramework>netcoreapp5.0</TargetFramework>
来自网络标准2.1
我的包裹是:
<PackageReference Include="Blazored.LocalStorage" Version="2.1.5" />
<PackageReference Include="Blazorise" Version="0.9.0.2" />
<PackageReference Include="Blazorise.Bulma" Version="0.9.0.2" />
<PackageReference Include="Blazorise.Components" Version="0.9.0.2" />
<PackageReference Include="Blazorise.DataGrid" Version="0.9.0.2" />
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="0.9.0.2" />
<PackageReference Include="Blazorise.Sidebar" Version="0.9.0.2" />
<PackageReference Include="Blazorise.Snackbar" Version="0.9.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="3.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Build" Version="3.2.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="3.2.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="3.2.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="5.0.0-preview.4.20251.6" />
<PackageReference Include="System.Net.Http.Json" Version="5.0.0-preview.4.20251.6" />
<PackageReference Include="Toolbelt.Blazor.I18nText" Version="9.0.1.1" />
<PackageReference Include="Toolbelt.Blazor.SpeechRecognition" Version="0.0.4.6-alpha" />
<PackageReference Include="Toolbelt.Blazor.SpeechSynthesis" Version="8.0.0" />
有什么想法可以解决这个问题吗?
附言。我确信它在像下面这样的样本中工作正常:https://channel9.msdn.com/Events/Build/2020/BOD104
我想,这个问题已经在这里得到了回答:
缺少 Blazor WebAssembly 3.1 目标框架
这没关系。这是最新版本的 Blazor WebAssembly 应用: .网络斯坦达德 2.1
与 Balzor Server App 不同,Blazor WebAssembly 应用程序在 单声道运行时。它不是.Net Core。