✅ 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•2mo ago
Message Not Public
Sign In & Join Server To View
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•2mo ago
Message Not Public
Sign In & Join Server To View
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 REPOQuoted by
<@689473681302224947> from #How do I pin both NET 8 and NET 6 sdk versions in global.json? (click here)
React with ❌ to remove this embed.
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
as far as im aware the reference assemblies do not change betweeen those patch versions
Is it possible that this is caused by projects targeting netstandard2.0?
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
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•2mo ago
Message Not Public
Sign In & Join Server To View
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
here's a minimal example that causes the issue (assuming nuget.org is disabled)
i only get the issue in a GitHub action though
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
GitHub
GitHub - acarrazzoni-qontigo/test
Contribute to acarrazzoni-qontigo/test development by creating an account on GitHub.
I think I found the issue. The global.json file had latestMajor. Changing it to latestPatch worked
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View