我收到此错误:
enter code here
System.TypeLoadException:无法解析来自typeref的标记为0100001a的类型(程序集'System.Runtime中的预期类'System.Threading.Tasks.Task',版本= 4.2.2.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a ')
当我切换到:
<TargetFramework>netcoreapp3.1</TargetFramework>
或
<TargetFramework>netcoreapp5.0</TargetFramework>
来自netstandard2.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" />
有解决此问题的主意吗?
ps。令我惊讶的是,它在以下示例中正常工作:https://channel9.msdn.com/Events/Build/2020/BOD104
答案 0 :(得分:2)
我认为,这里已经回答了这个问题:
Blazor WebAssembly 3.1 Target Framework is missing
这可以。这是Blazor WebAssembly App的最新版本: .NETStandard 2.1
与Balzor Server应用程序不同,Blazor WebAssembly应用程序在 单声道运行时。它不是.Net Core。