【发布时间】:2021-04-15 23:06:10
【问题描述】:
dotnet run(在 Windows 上)原因
warning CA1416: This call site is reachable on all platforms. 'WellKnownSidType.WorldSid' is only supported on: 'windows'.
我的程序设计为只能在 Windows 上运行。
我尝试将SupportedPlatform 添加到MyApp.csproj,但没有成功。
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.Negotiate" Version="5.0.5" />
<PackageReference Include="System.DirectoryServices" Version="5.0.0" />
<SupportedPlatform Include="Windows"/>
</ItemGroup>
</Project>
我做错了什么?如何向dotnet run 表明此项目仅适用于 Windows?
【问题讨论】: