c# - Blazor 模板的 csproj 中的 SupportedPlatform

标签 c# asp.net-core blazor blazor-webassembly

blazor“独立”模板将其包含在项目的 .csproj 中:

<ItemGroup>
  <SupportedPlatform Include="browser" />
</ItemGroup>

这是什么?它有记录在某处吗?

最佳答案

找到解释here :

Blazor WebAssembly apps target the full .NET API surface area, but not all .NET APIs are supported on WebAssembly due to browser sandbox constraints. Unsupported APIs throw PlatformNotSupportedException when running on WebAssembly. ... For Blazor WebAssembly apps, this means checking that APIs are supported in browsers

因此它通知分析器和编译器检查应用程序是否仅使用与 wasm 兼容的 BCL/FCL 类。

关于c# - Blazor 模板的 csproj 中的 SupportedPlatform,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72040920/

相关文章:

c# - 在 ASP.NET Core 中,从 Cookie 而不是 Headers 中读取 JWT token

c# - SendMailAsync 从不返回,仍然发送邮件

html - 在新标签页中打开 PDF - Blazor

javascript - WebAssembly 中的 .NET CLR

c# - Blazor : How can I Start Looping with Time ? 示例 - 2 分钟后生成一个问题

c# - TabControl.DrawItem 未在用户绘制的 TabControl 上触发

c# - 我怎样才能得到一个文件的路径?

c# - 如何将路径与文件名分开

asp.net-core - 调试器中的 ASP.NET Core 命令行参数

c# - 日期数组,检查日期是否存在