Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotnet-format 8.0 rc1 is failing on Alpine 3.17 #1945

Closed
NikolaMilosavljevic opened this issue Aug 23, 2023 · 2 comments · Fixed by #1948
Closed

dotnet-format 8.0 rc1 is failing on Alpine 3.17 #1945

NikolaMilosavljevic opened this issue Aug 23, 2023 · 2 comments · Fixed by #1948

Comments

@NikolaMilosavljevic
Copy link
Member

It appears that MSBuildLocator is not finding hostfxr library and .NET SDK, thus failing to provide MSBuild path.

Here's the failure output, from source-build tests:

System.InvalidOperationException : Failed to execute /src/git/dotnet4/test/Microsoft.DotNet.SourceBuild.SmokeTests/bin/Release/net8.0/.dotnet/dotnet format /src/git/dotnet4/test/Microsoft.DotNet.SourceBuild.SmokeTests/bin/Release/net8.0/projects-202308231813239264/FormatProject/FormatProject.csproj
  Exit code: 3

  Unable to locate MSBuild. Ensure the .NET SDK was installed with the official installer.

Perhaps getting rid of MSBuildLocator dependency is good option, considering that dotnet-format ships in SDK and should be able to find MSBuild directly.

@NikolaMilosavljevic
Copy link
Member Author

I've confirmed that this reproes outside of source-build tests.

I've extracted .NET 8 preview tarball and created symlink for dotnet in /usr/bin. dotnet format command is failing.

edb204ed8383:/src/proj8# dotnet new console
The template "Console App" was created successfully.

Processing post-creation actions...
Restoring /src/proj8/proj8.csproj:
  Determining projects to restore...
  Restored /src/proj8/proj8.csproj (in 174 ms).
Restore succeeded.


edb204ed8383:/src/proj8# dotnet format
Unable to locate MSBuild. Ensure the .NET SDK was installed with the official installer.

@JoeRobich
Copy link
Member

microsoft/MSBuildLocator#230

Perhaps getting rid of MSBuildLocator dependency is good option, considering that dotnet-format ships in SDK and should be able to find MSBuild directly.

I agree. Maybe keep MSBuildLocator as a fallback for those repos who still install as a local tool (see Roslyn).

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 a pull request may close this issue.

2 participants