-
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 is broken on sdk 7.0.200 if EnforceCodeStyleInBuild
is set to true
– Could not load file or assembly 'Microsoft.CodeAnalysis'
#1800
Comments
|
EnforceCodeStyleInBuild
is set to true
EnforceCodeStyleInBuild
is set to true
– Could not load file or assembly 'Microsoft.CodeAnalysis
EnforceCodeStyleInBuild
is set to true
– Could not load file or assembly 'Microsoft.CodeAnalysisEnforceCodeStyleInBuild
is set to true
– Could not load file or assembly 'Microsoft.CodeAnalysis'
As usual, `dotnet format` is broken on .NET 7.0.200 (see dotnet/format#1800). We'll install the latest of 7.0.100 for now.
Same is happening for me and all of my colleagues
|
Thanks for the heads-up, confirmed and if nothing else a good excuse to move to Directory.Build.Props |
I had the same problem |
Same here |
Idem, with |
Commenting out Not really a workaround per se, just skipping until fixed, but having it in |
Ok, thank you, I hope it will be fixed soon. |
I suspect that this is caused by dotnet-format's reference to the compiler getting out of date. #1782 |
@RikkiGibson Do you know if there are plans to assign a new maintainer to this project? |
Is there any Road Map for fixing this issue? .NET 7.0.4 is installed automatically with Visual Studio 2022 and for the past 4 months bundled dotnet-format is unusable. |
I've been getting this using .NET 8 in a dev container where .NET was installed using The project it runs into an exception while trying to format is an Incremental Source Generator. Solution: https://github.com/LorettaDevs/Loretta (devcontainer files are contained within)
|
This is a workaround to fix issues with dotnet-format. See: - dotnet/format#1805 - dotnet/format#1800
This is a workaround to fix issues with dotnet-format. See: - dotnet/format#1805 - dotnet/format#1800
This is a workaround to fix issues with dotnet-format. See: - dotnet/format#1805 - dotnet/format#1800
This seems to be an issue on 7.0.202 and 7.0.203 as well. |
This is a workaround to fix issues with dotnet-format. See: - dotnet/format#1805 - dotnet/format#1800
This is a workaround to fix issues with dotnet-format. See: - dotnet/format#1805 - dotnet/format#1800
This is a workaround to fix issues with dotnet-format. See: - dotnet/format#1805 - dotnet/format#1800
Absolutely yes for the integration test gap that needs to be filled. @sharwell to comment on the global json support. |
|
MSBuildLocator should be returning the pinned SDK first, if it was installed. format/src/Commands/FormatCommandCommon.cs Lines 350 to 352 in c99dcfe
Ideally, since the CLI launches the dotnet-format tool from the globla.json pinned SDK folder and the SDK has a particular layout, the tool would be updated to find the proper MSBuild using relative paths. |
This is a workaround to fix issues with dotnet-format. See: - dotnet/format#1805 - dotnet/format#1800
This is a workaround to fix issues with dotnet-format. See: - dotnet/format#1805 - dotnet/format#1800
This is a workaround to fix issues with dotnet-format. See: - dotnet/format#1805 - dotnet/format#1800
This is a workaround to fix issues with dotnet-format. See: - dotnet/format#1805 - dotnet/format#1800
# Pull Request ## 🤨 Rationale #1280 ## 👩💻 Implementation It looks like a the build agent began pulling in a new version of the .NET tools. `dotnet --info` prints out this for the CI build: ``` .NET SDKs installed: 6.0.408 [/usr/share/dotnet/sdk] 7.0.105 [/usr/share/dotnet/sdk] 7.0.203 [/usr/share/dotnet/sdk] 7.0.302 [/usr/share/dotnet/sdk] ``` So I'm guessing that 7.0.302 is causing issues. I found [dotnet/format#1800](dotnet/format#1800) which is pretty close to what we're seeing. [This comment](dotnet/format#1800 (comment)) makes it sound like there'll be a newer 7.0.3xx version that will fix this problem, but the issue is still open so I guess that version isn't out yet. Also see [dotnet/format#1834](dotnet/format#1834) and [dotnet/sdk#32598](dotnet/sdk#32598) which reference 7.0.302 and the DLL v4.6.0.0 specifically. Changes in this PR: - Re-enable Blazor C# linting in package.json - Add a [global.json](https://learn.microsoft.com/en-us/dotnet/core/tools/global-json) file to ensure the `dotnet` commands are using .NET 6.0.xxx tooling. - This will ensure both the CI and local builds are using the .NET 6 SDK for the `dotnet` CLI commands - Add a pipeline step to print out `dotnet --info`, which will print out all the installed .NET SDK versions, which should make it easier to debug issues like this in the future - Update docs to explicitly call out that a .NET SDK install `6.0.202 <= v < 7` is required - Update the CI build (`main.yml`) `setup-dotnet` action to refer to global.json to get the required .NET version to install (so we're not encoding the required version in multiple places in code) ## 🧪 Testing CI build + re-built locally. ## ✅ Checklist - [x] I have updated the project documentation to reflect my changes or determined no changes are needed.
This is a workaround to fix issues with dotnet-format. See: - dotnet/format#1805 - dotnet/format#1800
This is a workaround to fix issues with dotnet-format. See: - dotnet/format#1805 - dotnet/format#1800
This is a workaround to fix issues with dotnet-format. See: - dotnet/format#1805 - dotnet/format#1800
Both this problem and dotnet/sdk#32598 seem to have been fixed in sdk 7.0.304. |
This is a workaround to fix issues with dotnet-format. See: - dotnet/format#1805 - dotnet/format#1800
Awesome!! Yup, I can confirm that we can now use |
@brminnick Thanks for the confirmation! Closing. |
This is a workaround to fix issues with dotnet-format. See: - dotnet/format#1805 - dotnet/format#1800
This is a workaround to fix issues with dotnet-format. See: - dotnet/format#1805 - dotnet/format#1800
This is a workaround to fix issues with dotnet-format. See: - dotnet/format#1805 - dotnet/format#1800
This is a workaround to fix issues with dotnet-format. See: - dotnet/format#1805 - dotnet/format#1800
This is a workaround to fix issues with dotnet-format. See: - dotnet/format#1805 - dotnet/format#1800
This is a workaround to fix issues with dotnet-format. See: - dotnet/format#1805 - dotnet/format#1800
This is a workaround to fix issues with dotnet-format. See: - dotnet/format#1805 - dotnet/format#1800
This is a workaround to fix issues with dotnet-format. See: - dotnet/format#1805 - dotnet/format#1800
* Add workflow to perform automated checks for PRs * Downgrade Microsoft.CodeAnalysis to 4.4.0 This is a workaround to fix issues with dotnet-format. See: - dotnet/format#1805 - dotnet/format#1800 * Adjust editorconfig to be more compatible with Ryujinx code-style * Adjust .editorconfig line endings to match .gitattributes * Disable 'prefer switch expression' rule * Remove naming styles These are the default rules, so we don't need to override them. * Silence IDE0060 in .editorconfig * Slightly adjust .editorconfig * Add lost workflow changes * Move .editorconfig comment to the top * .editorconfig: private static readonly fields should be _lowerCamelCase * .editorconfig: Remove alignment for declarations as well * editorconfig: Add rule for local constants * Disable CA1822 for HLE services * Disable CA1822 for ViewModels Bindings won't work with static members, but this issue is silently ignored. * Run dotnet format for the whole solution * Check result code of SDL_GetDisplayBounds * Fix dotnet format style issues * Add missing trailing commas * Update Microsoft.CodeAnalysis.CSharp to 4.6.0 Skipping 4.5.0 since it breaks dotnet format * Restore old default naming rules for dotnet format * Add naming rule exception for CPU tests * checks: Include all files before excluding paths * Fix dotnet format issues * Check dotnet format version * checks: Run dotnet format with severity info again * checks: Disable naming style rules until they won't crash the process anymore * Remove unread private member * checks: Attempt to run analyzers 3 times before giving up * checks: Enable naming style rules again with the new retry logic
step to reproduce
add
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
to .csprojadd global.json
everything is ok here.
and now there are a lot of
in output
The text was updated successfully, but these errors were encountered: