-
Notifications
You must be signed in to change notification settings - Fork 742
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
Race condition when using C# 9.0 source generators #4924
Comments
@pjgpetecodes oh boy, I was having the same issue here, glad to Know that is not only on my environment. But it seems to me that the root cause is not Uno. Latest versions of A workaround I tested here is to downgrade |
Ooo... I had a sneaky feeling that this was an issue with Omnisharp for sure... I'll give that workaround a go and let you know... Thanks! |
Yes... This works @microhobby... Thanks! It took a couple of goes for the downgrade to take mind you... I dunno if it's related to this issue... dotnet/vscode-csharp#3891 |
@pjgpetecodes thanks for confirming, I have no idea what may have changed that is breaking Roslyn, but it would be good to open an issue in the omnisharp project. I will see if I can gather some logs to open this at the beginning of the week, or of course fell free to open it if you want to. |
Interesting issue. It's likely that OmniSharp is having a race condition issue with the generated editorconfig file, as there's no coordination between what omnisharp is doing, and builds done through the command line. Can you try adding this: <PropertyGroup>
<UnoUIUseRoslynSourceGenerators>false</UnoUIUseRoslynSourceGenerators>
</PropertyGroup> to your project ? See this code for reference: uno/src/SourceGenerators/Uno.UI.SourceGenerators/Content/Uno.UI.SourceGenerators.props Line 23 in 10528e1
It may be something that needs to be reported to the Roslyn team, I'll dig further. |
Thanks Jerome! That seems to work with the latest C# Extension installed now... It feels slower to build now, but that might just be me imagining it! Ha. Thanks again! |
Thanks for the update! Yes, building without the C# 9.0 generators is somewhat slower, that's one the reasons for Uno to move to this new generators framework. I'm waiting to see if the roslyn team has a cue on this. |
@jeromelaban it works very well and I would say it works better for those who use VS Code. With Roslyn so far to work with the IntelliSense and code tips for code behind I had to use the |
Another note about this. Using Maybe a solution is add |
Related issue: dotnet/roslyn#51768 |
This is fixed in uno 4.0+ builds. |
Current behavior
Building a Hello World project in VS Code on Windows results in a build error;
Oddly, if I open the project in VSCode and immediately build it works... If I leave it until VS Code has finished loading everything up then it doesn't.
Building using a terminal (Both PowerShell and CMD) results in the same issue.
I've attached a binlog as requested.
I also tried a
dotnet clean
before a build with the same results in VSCode and a command prompt.Expected behaviour
Build successfully.
How to reproduce it (as minimally and precisely as possible)
Interestingly... If I try to build the project from the command line (External command prompt), with VSCode open, then the build fails as above. But, closing VSCode and simply building again works.
I wonder could this be a plugin issue? Or even an issue with Omnisharp maybe?
Workarounds
Environment
Dot NET: 5.0.102
Uno UI: 3.5.0-dev.105
Windows 10 Pro 19042.746
Build Task:
Nuget Package:
Nuget Package Version(s):
VS Code Extensions;
Affected platform(s):
IDE:
Relevant plugins:
Anything else we need to know?
dotnet clean
before building.binlog:
msbuild.zip
The text was updated successfully, but these errors were encountered: