Hi,
I have a project that I'd like to keep buildable for Linux and Windows for the time being. The problem is it relies on IBM DB2 library which has a separate nuget for Linux and Windows. I have found a way to use RuntimeIdentifiers property in csproj file, and that with dotnet build -r switch allows me to specify which runtime to target during build, but I haven't yet found a way to specify the runtime during build triggered by WSL2 debug button on Visual Studio 2022 toolbar.
Any way to specify runtimeIdentifier without cmd line?
<PropertyGroup>
<RuntimeIdentifiers>win10-x64;linux-x64</RuntimeIdentifiers>
</PropertyGroup>
<Choose>
<When Condition="$(RuntimeIdentifier) != ''">
<ItemGroup>
<PackageReference Include="Net.IBM.Data.Db2-lnx" Version="6.0.0.300" Condition="$(RuntimeIdentifier.StartsWith('linux-x64'))"/>
<PackageReference Include="Net.IBM.Data.Db2" Version="6.0.0.300" Condition="$(RuntimeIdentifier.StartsWith('win-x64'))"/>
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<PackageReference Include="Net.IBM.Data.Db2-lnx" Version="6.0.0.300" Condition="$([MSBuild]::IsOsPlatform('Linux'))"/>
<PackageReference Include="Net.IBM.Data.Db2" Version="6.0.0.300" Condition="$([MSBuild]::IsOSPlatform('Windows'))"/>
</ItemGroup>
</Otherwise>
</Choose>