-
Notifications
You must be signed in to change notification settings - Fork 172
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 cannot find MSBuild on SDK 7.0.101 #1785
Comments
I'm seeing the same, but only on macOS. My Ubuntu and Windows builds work fine with 7.0.101. |
There's a bug on macOS causing `dotnet format` to fail. See dotnet/format#1785.
Consolidate .NET installations using a new syntax: https://github.com/actions/setup-dotnet#usage. Pinning to .NET SDK 7.0.100 due to a bug executing `dotnet format` on macOS. See dotnet/format#1785.
- `dotnet format` is broken on macOS with .NET SDK 7.0.101 (see dotnet/format#1785). So, we're installing 7.0.100 in addition to the latest and patching the `global.json` file at build time on macOS to prevent rolling forward to the latest SDK version. This means we'll use the latest on Windows and Linux, but macOS will be pinned o 7.0.100 for now until it's fixed.
- `dotnet format` is broken on macOS with .NET SDK 7.0.101 (see dotnet/format#1785). So, we're installing 7.0.100 in addition to the latest and patching the `global.json` file at build time on macOS to prevent rolling forward to the latest SDK version. This means we'll use the latest on Windows and Linux, but macOS will be pinned o 7.0.100 for now until it's fixed.
Seeing the same problem on |
Still an issue on |
I got this issue on For some reason, MSBuildLocator does not find
On Adding a symlink in the sdk directory works as a workaround until it is fixed. ln -s /usr/share/dotnet/host/fxr/7.0.2/libhostfxr.so /usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.2/libhostfxr.so |
Running this locally on MacOS with dotnet version
And getting same issue
|
Have you tried |
@craigktreasure i've just installed the latest version (macos/7.0.200/arm64) and i get the same error: ❯ dotnet format
Welcome to .NET 7.0!
---------------------
SDK Version: 7.0.200
Telemetry
---------
The .NET tools collect usage data in order to help us improve your experience. It is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.
Read more about .NET CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry
----------------
Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
Learn about HTTPS: https://aka.ms/dotnet-https
----------------
Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
--------------------------------------------------------------------------------------
Unable to locate MSBuild. Ensure the .NET SDK was installed with the official installer. |
I was unable to use |
@craigktreasure i've tried with |
I updated my MacOS to Ventura 13.2.1 and dotnet format now works. Was previously on macOS Catalina so possible that isnt supported by dotnet 7 |
It's still not working in Alpine images
Surprisingly, it works after installing
The sdk provided by the image is located at Also, using |
Still an issue on the 8.0-preview image as well:
Note that |
Getting the same issue in alpine 7.0.103-alpine3.17 |
Getting the same issue with multiple versions. Have tried newest release and downgrading 😞 |
I'm not an expert, but it seems that the release/7.x branch is in working condition. I built and installed it locally and it works for me. However, there's not a build for the latest from that branch in the .NET 7 NuGet feed (https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json). Feels like they need to spin a new build and for the SDK to pick it up. Not sure how often that happens. To some extent, I kinda wish support would go back to the |
Still an issue on |
I believe this another symptom of this - microsoft/MSBuildLocator#210 |
Still an issue on RUN ln -s /usr/share/dotnet/host/fxr/7.0.5/libhostfxr.so /usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.5/libhostfxr.so |
@devatwork thanks a million, this actually worked... |
This seems to be resolved in the latest stable Alpine image sdk version ( |
Working on the |
It fails with the error message
Unable to locate MSBuild. Ensure the .NET SDK was installed with the official installer.
.Steps to reproduce:
Output of
dotnet format --version
:7.0.352902+f7beff0efdb20b8f22516d310279204a3fa9ef50
The text was updated successfully, but these errors were encountered: