-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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-sdk-9.0.100-rc.2.24474.11] paint.netcore build with errors about elements from Microsoft.Windows.SDK.NET are not found #43707
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
1 similar comment
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Hi @jaredpar and @arkalyanms, this issue was also found during source compat testing, could you please take a look at it and confirm if this RC2 blocker? Thanks. CC: @marcpopMSFT |
This is similar to the other issue. Can you grab a compiler log for this too? Again though, this is very very unlikely to be a compiler bug. It's much more likely to be either a codegen bug in the generator or a bug in the SDK for including the generator. We should be getting the owner of that generator into the conversation so we can figure out what is happening here. |
@merriemcgaw do you know anything about the source generators that are part of the Windows SDK, and/or who we could pull in to take a look here? |
and maybe @Sergio0694 knows if there's something we should be looking at |
Does that source explicitly have |
@Sergio0694 the repro sample has |
Then that's the problem. That version is uber outdated and won't work correctly by design. You should be able to just remove it. The new .NET 9 SDK will already set the right one for the profile in use. Alternatively, bump that to .45 and try again. Either way the fact you were getting those errors when using that package version with the .NET 9 SDK is by design 🙂 |
@Sergio0694 Did this requirement change between rc1 and rc2? Is there a breaking change notice to track the behavior different in .NET 8 and .NET 9? Basically how to we help users either not get broken or guide them through the upgrade. This kind of hard-to-diagnose error is something we really try to avoid in the SDK because it harms adoption of new versions. |
Yeah, I merged #41936 which added support for profiles. We needed this for UWP on .NET 9.
I believe we might not have diagnostics in the specific scenario where you're not using UWP nor WinAppSDK. Worth noting though that manually setting that property is explicitly not recommended and only meant to be used in advanced scenarios by users wanting to test preview bits. If they explicitly set an old version and forget to update it, that's kinda on them. If you don't set that and just let the .NET SDK select the right package version for you, things will just work as expected. Not saying we can't or shouldn't potentially improve the diagnostics here, but worth pointing out that this is not the normal scenario. cc. @manodasanW thoughts on this? |
Is there a way to raise a diagnostic here? It seems reasonable, given this example, that customers will get into this problem. Can we proactively add a diagnostic here to warn them? Diagnostics are easy to attach to README, FAQ, etc ... compilation errors are not. Basically how do we give customers an easy path forward. |
I'm imagining something like a 'known minimum version bound' property in the Windows SDK or something that the targets could use to warn the user if they are using a version of the WindowsSdkPackageVersion that is not supported by the targets. Something as simple as that linking to documentation about how to properly set up your project can go a very long way towards helping users upgrade and reducing user frustration with cheese-moving. |
I agree it would make sense to provide a warning where we detect that they are explicitly using an older version of the Windows SDK projection package with the .NET 9 SDK that is expecting a version that has profiles. The check should have an opt-out in case they are intentionally doing it while trying to fix other dependencies. |
In the case of .NET MAUI, not setting the We observed a similar issue with .NET 9 RC2 builds where MAUI apps started failing building with a 1.5 version of WindowsAppSDK suggesting setting an explicit Our choices seem to be explicitly setting |
Thanks all for helping look into this issue. After setting But a new issue occurs during build with error " |
@Junjun-zhao That one seems a valid error with two declarations, one in source code and one in the generated from the SDK. Is it not a test setup issue? |
We have repro machines available. My team(Junjun) is based in China and it is already weekend there, so it might be better to look at the repro machines to further investigate. Repro machine details are in the DevDiv bug(https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2261861) and VPN is needed to connect to the VMs. |
It is not a test setup issue,@jaredpar and @manodasanW have investigated and #43746 is an issue with the WinRT source generator microsoft/CsWinRT#1799 |
@jaredpar Any decision solution made for this issue? As we are going to sign off RC validation, could you help confirm if it is a RC2 blocker? |
@Junjun-zhao Jared's team doesn't own these fixes. There are discussions going on about these fixes and associated timelines in Teams. Richa and others are aware of these issues. We need to wait for decision/update. I will let you know once an update is available in the RC2 Teams chat. |
@manodasanW We verified this issue with the latest build dotnet-sdk-9.0.100-rtm.24515.15, it has been fixed. Thanks. |
Application Name: paint.netcore
OS: Windows 10 21H2
CPU: X64
.NET Build Number: dotnet-sdk-9.0.100-rc.2.24474.11
App & Source Location checking at: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2261861
Verify Scenarios:
1). Windows 10 21H2 AMD64 + dotnet-sdk-8.0.300: Pass
2). Windows 10 21H2 AMD64 + dotnet-sdk-9.0.100-rc.1.24452.12: Pass
3). Windows 10 21H2 AMD64 + dotnet-sdk-9.0.100-rc.2.24470.13: Fail
4). Windows 10 21H2 AMD64 + dotnet-sdk-9.0.100-rc.2.24474.11: Fail
Description :
When build the 3rd party application paint.net with the latest .NET 9 sdk, it failed with errors:
Minimal Repro Steps: (Demo attached:ConsoleDemo.zip)
The machine has dotnet-sdk-9.0.100-rc.2.24474.11 installed.
1.Create a .NET 8 Console application.
2. Update the csproj file with following changes:
Expected Result:
Build Successful.
Actual Result:
Build with following errors:
Please refer to Binlog and Compiler log from msbuild_binlog complog.zip
Findings:
We found all the namespaces/types in errors come from Microsoft.Windows.SDK.NET. When using dotnet-sdk-9.0.100-rc.2.24474.11 to build the app, the "Windows" namespace is not be recognized by compiler and the elements from "Windows" namespaces are also cannot be recognized.
App Repro Steps on repro machine:(dotnet-sdk-9.0.100-rc.2.24474.11 installed)
Please get the repro machine information from DevDiv bug:
dotnet build
" in C:\Users\Test01\Desktop\paint.net\PaintDotNet.Expected Result:
Build successfully.
Actual Result:
Build failed with errors:
Dotnet Info:
@dotnet-actwx-bot @dotnet/compat
The text was updated successfully, but these errors were encountered: