-
Notifications
You must be signed in to change notification settings - Fork 173
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 exception with source generator #1461
Comments
I have the same issue. I am sure it is bound to a source generator. Did you find any work-around? |
I have a stack trace if it helps. (Project build works normaly)
|
No, I did not find any work-around for now. |
Some general thoughts on source generator support in dotnet-format. It may not be obvious but dotnet-format does not build your project or solution. If your project has a project reference that is a source generator, then it will be necessary to I've done a little investigation into the ReservationServer issue and it seems to be falling over trying to load the dependencies. I wonder if it is related to dotnet/docs#25785. I'll have to resume the investigation after the holiday break. |
Great thanks for your effort @JoeRobich , while I already had a |
👋 @WeihanLi, I think I have a similar issue, already filed an issue but I guess it is basically the same bug. |
Also running into this. This started with the .NET 6 SDK - we had no issues with dotnet-format 5.x. |
This happens on projects which use Refit v6.2.16 with |
I've also ran into this issue while trying to lint a source generator in combination with a background worker. Fun fact: Linting works with the old version of dotnet-format as you can see in the workflow run above. |
Hm - also having this issue in combination with https://github.com/ChilliCream/graphql-platform/tree/main/src/StrawberryShake CodeGenerators. Please fix! |
Referencing the following project: I would not expect this solution to work in its current form. At first glance, errors include:
|
Actually, the source generator does work for me, I changed back to T4 to makes the |
Describe the bug
When I use the
dotnet format
command to format code, I got some errorsCould not load file or assembly
, it may relate to source generator.To Reproduce
There's a sample Github-Action CI https://github.com/OpenReservation/ReservationServer/runs/4492767423, and the project could be built locally https://github.com/OpenReservation/ReservationServer/tree/78dda500c1e93002d53e2c61a3b6591b33b490e3
Exceptions
Further technical details
dotnet --info
The text was updated successfully, but these errors were encountered: