Skip to content

Update Oryx feature to install if a newer version of .NET is present - #769

Closed
seesharprun wants to merge 6 commits into
devcontainers:mainfrom
seesharprun:patch-1
Closed

Update Oryx feature to install if a newer version of .NET is present#769
seesharprun wants to merge 6 commits into
devcontainers:mainfrom
seesharprun:patch-1

Conversation

@seesharprun

Copy link
Copy Markdown

Oryx fails to install if a newer version of .NET is present.

I suspect this is due to a missing --framework argument.

I also took this opportunity to spell out the full name of other dotnet build and dotnet publish arguments to make it easier to debug for the person that comes next.

@seesharprun

seesharprun commented Nov 30, 2023

Copy link
Copy Markdown
Author

@seesharprun

Copy link
Copy Markdown
Author

There is still some more work that needs to be done. Even on my local machine, I can't build Oryx from source if I have both .NET 7 and .NET 8 installed.

@seesharprun

Copy link
Copy Markdown
Author

It looks like the feature runs dotnet --version which will always return the latest version of .NET.

Instead it should check dotnet --list-sdks to see if .NET 7 is included in the list.

@seesharprun

Copy link
Copy Markdown
Author

A little more investigating has uncovered that some of the assemblies (Ex: Microsoft.NET.Sdk.Razor/source-generators/Microsoft.NET.Sdk.Razor.SourceGenerators.dll) will always use the latest .NET version if multiple versions are enabled.

I looked around on GitHub and found a couple of example issues where the .NET team says this is intentional behavior. They don't want someone to "freeze" on an old dependency and lock it in for years after moving on to newer versions of .NET.

@seesharprun

Copy link
Copy Markdown
Author

I have a new PR open on the Oryx repo to see if they are willing to bump their .NET 7-locked dependencies forward so the project can be built on both a .NET 7 and a .NET 7 + 8 environment.

@samruddhikhandale

Copy link
Copy Markdown
Member

Feel free to close this in favor of #825 which should unblock devcontainers/images#855

@seesharprun
seesharprun deleted the patch-1 branch January 31, 2024 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants