-
Notifications
You must be signed in to change notification settings - Fork 107
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
CS8785 error after updating from 8.0.304 to 8.0.306 SDK #1828
Comments
As per the recommendation of @manodasanW we attempted to use the version published last night
via: dotnet/sdk#44145 This did not fix the issue, the error remains the same. |
Thanks for trying out the new build. Can you confirm whether you have any special characters in your project / assembly name and if so which? If you do, I think our escaping logic is incomplete and I think I am going to take a new approach to fix that. For
|
Even with diag logging, the string "'WinRTAotSourceGenerator' failed to generate source" does not exist in the log file. The only hits on WinRTAotSourceGenerator are still these:
We only see this issue in 2 of our 1200 csproj files, i cannot find a pattern yet. This project itself is one of our 50 SpecFlow projects, it may have "many" project and package references, but the project itself does not contain a whole lot. In the diag logs i can confirm version 52 is used, as i see these lines
|
Try checking in your build output, not the |
This is output from the Output window in Visual Studio. |
It looks like the stack should be above the line that you shared. Can you check if it exists there? |
Above those you will find the csc.exe command line and header output. Nothing else. |
Oke, i tried the same steps on the 2nd project that fails, here we do see a callstack, hope this helps:
|
To be user again with .52, but looks the same
|
What is the signature of the |
I hope this is sufficient
|
We are able to reproduce this in a sample project, do you have a way for me to share this with you? |
Thanks for all this information, I was able to reproduce the exception with what you have provided. I may need some additional information for the first issue with |
Great, we have also narrowed down the "problem" of our SpecFlow project.
So far we are unable to cause a failure for this in a sample solution. |
A question though, why is this generator suddenly enabled? Both on net6 and net8? Please advise. |
The generator was added to make C#/WinRT AOT compatible, and they were added as you specified the Windows 10+ TFM. The |
Thanks, in our case, we don't make use of WinRT, or AoT. Yet the changes you applied do affect us and suddenly enable new features, even on older (NET6) products. We would like to request you to change the defaults of the SDK on the already released SDK's
This way, you don't introduce breaking changes in one of your patch releases, but allow users to get the functionality when they upgrade to a newer SDK. If i have to opt-out, i need to do this in 40 repositories, in 3 releases, so that means 120 pull requests. |
This is because since you're using the Windows 10 TFM, .NET assumes you wish to use WinRT. This WinRT-inclusion behavior is present on older versions of .NET as well, not just this new one. |
In addition to CsWinRTAotOptimizerEnabled, are there more properties we can disable to disable WinRT as a whole? |
You can remove the entire framework reference: <FrameworkReference Remove="Microsoft.Windows.SDK.NET.Ref" /> |
I tried to disable the AoTOptimizer, but it does not allow me it seems.
Above error is still reported, when using the default SDK, if i manually change it to 10.0.19041.52 it does allow me to disable it. |
Describe the bug
After updating the .NET 8 SDK from 8.0.304 to the latest 8.0.306 some or our projects targeting framework net8.0-windows10.0.19041 fail with error.
We use Visual Studio 2022 17.10.7.
and
We did find that adding this to our Directory.Build.props code base "resolves" the issue, though in the documentation we can read its not recommended to use this property.
For now we can keep this as a workarround, but we would like to understand the proper fix.
To Reproduce
I have not been able to reproduce this yet outside our own code base. We don't know where this code generator comes from and what it triggers.
Exceptions (if any)
and
Further technical details
.NET SDKs installed:
2.1.202 [C:\Program Files\dotnet\sdk]
2.1.512 [C:\Program Files\dotnet\sdk]
3.1.423 [C:\Program Files\dotnet\sdk]
5.0.416 [C:\Program Files\dotnet\sdk]
6.0.310 [C:\Program Files\dotnet\sdk]
6.0.427 [C:\Program Files\dotnet\sdk]
8.0.304 [C:\Program Files\dotnet\sdk]
8.0.306 [C:\Program Files\dotnet\sdk]
Visual Studio 2022 - 17.10.7
Windows 10 / Windows 11 Version 23H2
The text was updated successfully, but these errors were encountered: