You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In one of my projects, I have an indirect dependency on the SkiaSharp package. After this dependency was added, I needed to add the nuget package SkiaSharp.NativeAssets.Linux.NoDependencies to make the code work on a linux platform.
I added the package conditionally by using the following Condition attribute on the PackageReference element in the csproj file: $([MSBuild]::IsOSPlatform('Linux')).
The consequence is that on a Linux machine, this package will show up in packages.lock.json, but it does not show up when the build is done on a Windows machine. Aside from the Linux platform, we also build in the OSX platform and a similar conditional package reference was added there too.
Is there a better way to approach these OS-dependent package dependencies that would allow us to keep the packages.lock.json consistent across platforms?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
In one of my projects, I have an indirect dependency on the
SkiaSharp
package. After this dependency was added, I needed to add the nuget packageSkiaSharp.NativeAssets.Linux.NoDependencies
to make the code work on a linux platform.I added the package conditionally by using the following
Condition
attribute on thePackageReference
element in thecsproj
file:$([MSBuild]::IsOSPlatform('Linux'))
.The consequence is that on a Linux machine, this package will show up in
packages.lock.json
, but it does not show up when the build is done on a Windows machine. Aside from the Linux platform, we also build in the OSX platform and a similar conditional package reference was added there too.Is there a better way to approach these OS-dependent package dependencies that would allow us to keep the
packages.lock.json
consistent across platforms?Thanks,
Ruben
Beta Was this translation helpful? Give feedback.
All reactions