✅ How do I pin both NET 8 and NET 6 sdk versions in global.json?

hi everyone! if I pin the 8.0.204 sdk in global.json for some reason it wants to pull version 6.0.35 of the Microsoft.NETCore.App.Ref nuget package. is there a way to pin both the 8.0.x and 6.0.x versions of those nuget packages? at my company we are using internal nuget repositories and we don't have a way to pull those internal SDK nuget packages automatically
17 Replies
Unknown User
Unknown User4d ago
Message Not Public
Sign In & Join Server To View
acarrazzoni-qontigo
I have several solutions that target both net 6 and net 8. I can't share the csproj files, sorry. What I need is to pin Microsoft.NETCore.App.Ref to a certain 6.0.x version for NET 6 projects, and a 8.0.x version for NET 8 projects And there are solutions that contain both net 6 and net 8 projects
Unknown User
Unknown User4d ago
Message Not Public
Sign In & Join Server To View
MODiX
MODiX4d ago
TeBeCo
if I pin the 8.0.204 sdk in global.json for some reason it wants to pull version 6.0.35 share your variopus csproj in an anonymized PUBLIC GIT REPO
React with ❌ to remove this embed.
Unknown User
Unknown User4d ago
Message Not Public
Sign In & Join Server To View
Aaron
Aaron4d ago
as far as im aware the reference assemblies do not change betweeen those patch versions
acarrazzoni-qontigo
Is it possible that this is caused by projects targeting netstandard2.0?
Unknown User
Unknown User3d ago
Message Not Public
Sign In & Join Server To View
acarrazzoni-qontigo
nuget restore fails for some projects because something wants version 6.0.35 of the Microsoft.NETCore.App.Ref and Microsoft.WindowsDesktop.App.Ref packages. this is despite using the 8.0.204 SDK nothing is referencing those projects, they just seem to be pulled by the SDK for some reason
Unknown User
Unknown User3d ago
Message Not Public
Sign In & Join Server To View
acarrazzoni-qontigo
I'm afraid I can't anonymize my repo since the csproj files contain dependencies on internal nuget packages. All of the errors that appear are Unable to find package Microsoft.NETCore.App.Ref with version (= 6.0.35) Unable to find package Microsoft.WindowsDesktop.App.Ref with version (= 6.0.35) Unable to find package Microsoft.AspNetCore.App.Ref with version (= 6.0.35) Let me double check
acarrazzoni-qontigo
here's a minimal example that causes the issue (assuming nuget.org is disabled)
acarrazzoni-qontigo
i only get the issue in a GitHub action though
Unknown User
Unknown User3d ago
Message Not Public
Sign In & Join Server To View
acarrazzoni-qontigo
GitHub
GitHub - acarrazzoni-qontigo/test
Contribute to acarrazzoni-qontigo/test development by creating an account on GitHub.
acarrazzoni-qontigo
I think I found the issue. The global.json file had latestMajor. Changing it to latestPatch worked
Unknown User
Unknown User3d ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server