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 - 如何从 ASP.NET Core 异常中间件返回 404?

c# - 角色/帐户更改时使 Identity Core 中的用户无效

asp.net-core - 在.Net core 3和blazor中捆绑css和js

c# - 有没有办法在 MVVM 中自动创建 DependencyProperty

c# - 通用方法与非通用方法 - 有任何性能优势吗?

c# - Unity3D iOS 64 位的 IL2CPP 编译器运行时错误

javascript - 通过 JavaScript 将 C# List<T> 中的多个属性显示到模态 UI

asp.net-core-2.1 - 当您通过 .razor 页面使用 HttpContext.SignInAsync 时,它不起作用

c# - 如何在 Blazor 中动态设置 ValidationMessage<TValue>.For 属性?