After developing ASP.NET apps exclusively for several years I'm about to start developing Winforms apps. What are the gotchas that I should be looking out for with this changes? For instance the way object lifetime is managed in the winforms paradigm. I'm sure there must be plenty of gotchas / differences between the two that I need to be mindful of.
Thanks.
In this article. Windows Forms support was added to . NET Core in version 3.0.
ASP.NET Web Forms isn't supported in ASP.NET Core (nor are ASP.NET Web Pages). Typically, the functionality of these pages must be rewritten when porting to ASP.NET Core. There are, however, some strategies you can apply before or during such migration to help reduce the overall effort required.
NET 5 / . NET 6 extends support for desktop technologies - WinForms and WPF, and continues to unify all . NET development frameworks.
There are many gotchas going from Winforms to ASP.NET. However going the other way you might just experience a breath of fresh air since it's all running in process and you have a fully stateful environment, meaning things won't disappear and be rebuilt.
At times you will be confused because you're still thinking in ASP.NET and the Winforms way is too easy. Prepare to bang your head against the desk and repeat "stupid, stupid, stupid... it's so obvious" and stuff like that.
However
Layout and design will feel a little more stringent compared to the natural flow of HTML and its application of CSS style separately.
For a more beautiful and richer UI you might want to consider WPF to succeed your Winform endeavours. This Microsoft section provides info on both technologies.
There will be a transition of course as you learn the classes specific to Winforms, however they feel similar to the ASP.Net versions, just simpler to implement.
In addition to @jdk's excellent answer...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With