The*_*Saw 5 c# csproj .net-core
假设我以这些方式构建我的项目。
dotnet publish -r win-x86
dotnet publish -r linux-musl-x64
Run Code Online (Sandbox Code Playgroud)
有没有办法在我的.csproj文件中自动包含基于所选RID的本机 DLL ?
您只需要Condition在 csproj 文件中要控制的元素上有一个。例如:
<PackageReference Include="MyLibrary.Linux" Version="1.0.0"
Condition="'$(RuntimeIdentifier)'=='linux-x64'" />
<PackageReference Include="MyLibrary.Windows" Version="1.0.0"
Condition="'$(RuntimeIdentifier)'=='win-x64'" />
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
530 次 |
| 最近记录: |