-
Notifications
You must be signed in to change notification settings - Fork 983
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
6.0.2 SDK update has broken WinForms apps #6663
Comments
@RussKie , is this because we are shipping refs with each servicing release now? |
@dreddy-work we do not ship the SDKs in servicing releases, we ship the ref packs. @EatonZ you're building an app on a higher version of .NET and trying to execute on a lower version. How do you configure SDKs in global.json? |
@RussKie I don't have anything custom for global.json, but my runtimeconfig.json comes out to be this:
To be clear, compiling on a new SDK and running on an older runtime has always worked for me, and my customers. |
@EatonZ it is indeed a major issue with the 6.0.2 servicing release. The assembly versions have been revved from 6.0.0 to 6.0.2, which is causing the issue you're facing. The team is currently discussing different ways this issue may be addressed and ways we can minimise the drama for developers like yourself. Unfortunately there's no easy way out here. |
@RussKie Thank you for confirming. I am fine with going back to building with 6.0.1 again. What is the correct procedure to do that now in a fully updated Visual Studio? It automatically replaced the old SDK with the latest, so what's the process in downgrading without breaking things? |
I believe you can install 6.0.1 from https://dotnet.microsoft.com/en-us/download/dotnet/6.0. In the global.json you can pin the SDK to 6.0.1 {
"sdk": {
"version": "6.0.101",
"rollForward": "disable"
}
} |
@RussKie Thank you, everything is back in a working state for me now. Full workaround steps for others who may need help:
That's it. When you debug your app you may notice it's still loading 6.0.2 DLLs, but when you run the app on a system with the 6.0.1 runtime, it will work/not crash. |
i have same problem after visual studio update. on clients installed 6.0.1 runtime, and all got a crash after run app |
This comment was marked as off-topic.
This comment was marked as off-topic.
thx for explain, otherwise no matter what I did, the version of the environment did not change to 6.0.1 |
For an available workaround please refer to dotnet/core#7176. |
Use Global.json to prevent upgrade to 6.0.2 until a better solution is found. Edit workflows to specify version. dotnet/winforms#6663
Use Global.json to prevent upgrade to 6.0.2 until a better solution is found. Edit workflows to specify version. dotnet/winforms#6663
6.0.3 is out now. Is this considered fixed? |
It should. We will cross verify and close it. @Olina-Zhang as FYI |
The issue is critical and it is not fixed in 6.0.3. |
Really? Our app build with 6.0.3 work fine on machines with 6.0.2... 🤷♂️ |
That's because .NET 6.0.2 and .NET 6.0.3 has System.Windows.Forms with version 6.0.2. |
And this is by design I think... |
No, it's not, it's a bug. :) It seems that it would not be fixed, as it was explained here: |
@RussKie to confirm the fix propagated to 6.0.3 installer. |
I checked and the 6.0.3 System.Windows.Forms dll is versioned 6.0.2.0. That is what they said would happen, so it appears the issues is fixed. My advice would be to wait a while for users' computers to update with this new version before building again with 6.0.2+. Building on 6.0.1 is the safest option for now. |
This is the fix. Between the bad and the worse, it was the best option available. Please refer to #6667 and dotnet/wpf#6101 (comment) for more details as to why this is considered a fix. Sadly, if you're shipping Windows Desktop apps targeting 6.0.0 or 6.0.1 you'll need to recompile for 6.0.2 or later. Likewise, if users don't have at least 6.0.2 runtime installed, they won't be able to run your apps compiled on 6.0.2 or later.
6.0.1, 6.0.2 and 6.0.3 are MSRC releases, and users are encouraged to update to the latest runtime/SDK available. |
This is all very depressing. .Net is 20 years old and it seems like MS still can't get the versioning of assemblies correct. I honestly think I spent 50% of my time coding an app and the rest trying to get builds and deployments working. It is not acceptable for a company with as much experience and expertise as MS to just say, "yeah this was wrong but we'll sort it out later". Not everyone has the luxury of rebuilding things or getting customers to update runtimes as easily as that. Not that this is the issue I had recently with my app but it leaves a really poor experience for people like me who really do like .Net and yet their first attempt at a dotnet core winforms app falls at the first hurdle and I still don't know why. |
Adding .NET 6.0.3 as a requirement fixed the issues I was experiencing. The TcNo Account Switcher I'm working on includes a C++ fallback to verify system requirements are met, and will auto-download new runtimes. While it's not a huge issue to me, it was incredibly confusing that it just broke after updating VS/Windows... |
Did we consider changing the version of the Microsoft.WindowsDesktop.App framework reference to 6.0.2? Currently the app silently fails - meaning it does nothing visually - no error output, no dialog, nothing. It's really hard to diagnose what happened. If it declared the 6.0.2 dependency, the host would provide a dialog asking the user to download the newer framework - so actionable feedback which can actually fix the problem on the user's machine. |
ℹ️ UPDATE: Workaround here for those who need it.
. . .
There appears to be a critical problem with the new 6.0.2 update which makes apps compiled with it fail to start on machines running 6.0.1.
To reproduce, do the following:
This problem did not happen on .NET 5. I was under the impression patch versions are generally compatible with each other, and I use
<RollForward>LatestPatch</RollForward>
in my real app, but even with that setting it still crashes.This is a blocking issue for me because if I distribute an update for my app built on 6.0.2 and the client is still running 6.0.1, that will be bad if the app suddenly stops working.
The text was updated successfully, but these errors were encountered: