.net-core - 来自 System.Private.CoreLib 的 WASM WebAssembly FileNotFoundException
问题描述
我正在尝试使用https://platform.uno/来构建一些工具。由于某些基本 Microsoft 库的 FileNotFoundExceptions,来自 uno-platform 模板的 WASM (WebAssembly)-Project 将无法启动。我从 uno 模板创建了一个新的 uno 平台 APP。我已将所有 NuGet 包更新到最新版本。当我启动 wasm 网络项目时,我得到以下异常(我猜是在引导程序中):
在这里你可以看到 Exception 类来自图 1 中没有找到的命名空间。这对我来说很奇怪,我不知道是怎么回事了。我想这是某个地方的依赖项中的先决条件或错误版本的问题。有人知道怎么回事吗?
这是 WASM 项目的 csproj:
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netstandard2.0</TargetFramework>
<WasmHead>true</WasmHead>
<DefineConstants>$(DefineConstants);__WASM__</DefineConstants>
<NoWarn>NU1701</NoWarn>
<StartupObject>Macs3.Calculations.TestTool.Wasm.Program</StartupObject>
<MonoRuntimeDebuggerEnabled>true</MonoRuntimeDebuggerEnabled>
</PropertyGroup>
<ItemGroup>
<Content Include="..\Macs3.Calculations.TestTool.UWP\Assets\*.png" Link="Assets\%(FileName)%(Extension)" />
<Content Include="Fonts\winjs-symbols.woff2" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="WasmCSS\Fonts.css" />
<EmbeddedResource Include="WasmScripts\AppManifest.js" />
</ItemGroup>
<ItemGroup>
<LinkerDescriptor Include="LinkerConfig.xml" />
</ItemGroup>
<ItemGroup>
<!--
This item group is required by the project templace because of the
new SDK-Style project, otherwise some files are not aded automatically.
You can safely remove this ItemGroup completely.
-->
<Compile Remove="Program.cs" />
<Compile Include="Program.cs" />
<Content Include="LinkerConfig.xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Uno.UI" Version="1.46.0-dev.2039" />
<PackageReference Include="Uno.Wasm.Bootstrap" Version="1.0.0-dev.298" />
</ItemGroup>
<Import Project="..\Macs3.Calculations.TestTool.Shared\Macs3.Calculations.TestTool.Shared.projitems" Label="Shared" Condition="Exists('..\Macs3.Calculations.TestTool.Shared\Macs3.Calculations.TestTool.Shared.projitems')" />
</Project>
解决方案
推荐阅读
- javascript - 在 Microsoft Graph 中的两个日期之间获取电子邮件
- flutter - 实现 facebook 像素颤动
- r - str将字符串拆分为字符,但保留图表
- python - Python3.8 打印带下划线的长数字(pprint)
- python - ErrNo 2:没有这样的文件或目录 - 没有找到解决方案
- html - 如何相对于其父 div 移动 div 内的项目
- javascript - 无法读取未定义问题的属性“地图”
- ios - 如何在 swift 4 中使用 Share Sheet 扩展将 iPhone 设备屏幕截图分享到我们的应用程序中
- java - java:S2189:“向这个循环添加一个结束条件。”。请你帮助我好吗?
- php - WordPress 注册电子邮件通知