Blazor 模板的 csproj 中的 SupportedPlatform

SupportedPlatform in Blazor template's csproj

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

所以它通知分析器和编译器检查应用程序只使用 BCL/FCL 类 是 wasm-compatible.