Fixing a Common WinForms Bug (CS0103) in 10 Minutes or Less

  Рет қаралды 4,235

IAmTimCorey

IAmTimCorey

28 күн бұрын

Have you ever had an issue when working on a Windows Form where the form designer wouldn't even load? You get this blue, yellow, and white error message saying error CS0103. That error is a rather common one to experience when you first start out. Thankfully, it is also a very easy one to fix.
Full Training Courses: IAmTimCorey.com
Mailing List: signup.iamtimcorey.com/

Пікірлер: 28
@andergarcia1115
@andergarcia1115 26 күн бұрын
Absolutely! This is a common error many people face when starting Win Forms projects, specially without a strong foundation in the basics. Thanks Master
@IAmTimCorey
@IAmTimCorey 26 күн бұрын
You are welcome.
@webluke
@webluke 26 күн бұрын
I had that problem so many times when I was new; accidentally creating an event, hitting CTRL+Z, and seeing your form bug out, and not understanding partials was tough.
@IAmTimCorey
@IAmTimCorey 26 күн бұрын
Thanks for sharing!
@rameshvegi94
@rameshvegi94 26 күн бұрын
Thanks Tim. I know on how to solve this the next time i face this problem.
@IAmTimCorey
@IAmTimCorey 26 күн бұрын
Great!
@mynameisshadywhat
@mynameisshadywhat 18 күн бұрын
I first started my career as a developer working on a WinForms app that had been in production, still being used after 10 years even though being neglected for most of it. After struggling to fix everything over several years we took the path of migrating it and all of its different projects from .NET Framework 2.0/3.5 to .NET Framework 4.8 then later .NET 7 and the solution from Visual Studio 2008 to 2022 (redeveloping it not an option apparently), the improvements in the designer were underwhelming, especially this exact problem.
@IAmTimCorey
@IAmTimCorey 18 күн бұрын
Yeah, WinForms hasn't progressed a lot in terms of the designer or tooling. The speed of the underlying code is incredibly different, but it does feel like the tooling has not been a big focus.
@AvgDan
@AvgDan 23 күн бұрын
Creating a form to inherit from to use as a base font/color template as well as some commonly called base methods could make a good short video. How do you like the chevrons instead of +/- for expand/collapse regions? I hate the change and changed the color of the "Outlining Margin Vertical Rule" to cyan so the chevrons didn't blend in as much, and changed the color of collapsed text to stand out as well.
@IAmTimCorey
@IAmTimCorey 23 күн бұрын
Form inheritance can be really helpful. I had a client (when I was consulting) that we ended up creating multiple base forms they could inherit from in order to bring in some default behaviors. I'm not sure I would use inheritance for the base font/colors, though. I would probably create a new item template that had those things set to different defaults instead. That keeps things simpler.
@kenjohnsiosan9707
@kenjohnsiosan9707 26 күн бұрын
sir I have a question, what is it in your course that I should go with initially. im planning to subscribe monthly. im new to C# but I've been a PHP dev for quite some time. thanks
@IAmTimCorey
@IAmTimCorey 26 күн бұрын
The place to start is definitely the C# Mastercourse: www.iamtimcorey.com/courses/csharp-mastercourse/ It is designed to take you from knowing nothing to being able to fill a junior or even mid-level developer role, depending on how much you practice along the way.
@tetsballer1835
@tetsballer1835 26 күн бұрын
you think VS could detect the function being deleted and maybe comment out the event assignment in the designer.
@IAmTimCorey
@IAmTimCorey 26 күн бұрын
That would be nice, although there are negative implications if you do that. Deleting code is a whole lot trickier than creating code.
@Gbtx6
@Gbtx6 26 күн бұрын
I learned about this is the hard way a few years back 😂😂 i think at the time i ran into a bug that deleted some exta code i had too.
@IAmTimCorey
@IAmTimCorey 26 күн бұрын
It can be a frustrating one.
@rusektor
@rusektor 26 күн бұрын
Alternatively, you could just click the hyperlink in an error message which will bring you right to the line with error (no need to search this one manually).
@IAmTimCorey
@IAmTimCorey 26 күн бұрын
True, but I wanted to show where it was instead of a code window magically opening to the right place.
@scottstrand7865
@scottstrand7865 26 күн бұрын
Why does anyone use winforms at all anymore? Haven't they been deprecated?
@IAmTimCorey
@IAmTimCorey 26 күн бұрын
Just the opposite, actually. Let's start with "why use WinForms". A large portion of desktop applications in production today are WinForms. The reason why is because WinForms has been around for over 20 years. When you start building on a technology, you don't typically change from that technology. That means WinForms had a major head start over other UI options. Then, WPF was new technology and people didn't like XAML. Those two things stunted its growth. That means that even when WPF came out, businesses didn't start adopting it right away. Companies have a heavy investment in their applications. They cannot just change because they like a new UI better. That takes a LOT of time and time is money. I worked at one company where we had 17 developers. They wanted to transition from one tech to another. It was going to take 18 months to get there, plus it was going to slow down current development to a crawl. They kept putting it off because of the cost implications. Think of how much that would cost. 17 developers times 18 months. At a very conservative $100,000/year/developer (don't forget that would mean a salary of about $65,000 since benefits are expensive), that would be a cost of $2.5 million. How do you justify that to an executive when the result is the same application visually and they can't get any (or many) new features for almost two years? Hint: you don't. And that is for a small company (less than 500 employees). A larger company would be even worse, if it is even possible. So, when you are looking for a job, you might want to work with the latest technologies, but most likely you will end up in an established organization. Depending on how long they have been around, the technology they are working with might be 5-15 years old. That doesn't mean they haven't done any updates. It most likely is going to be a spectrum, where there are some old things and some newer things. So, learning WinForms is important for that reason. As for the question of WinForms being deprecated, the answer is no. WinForms is being actively maintained. It is currently on .NET 8 and there are changes coming to it for .NET 9 in November. But let's look at the other desktop UI options from Microsoft. WPF is still around, although development has been sent to India (still Microsoft) which is usually an indication that a technology is in maintenance mode rather than development mode. UWP has been deprecated. WinUI 1 & 2 have been deprecated. WinUI 3 is still active, although based upon the fact that you have to be on Windows 10+ to run it, I doubt it will be around for long (companies can't usually make that type of commitment to a limited number of operating systems). Xamarin is going to be deprecated next month (May 2024). MAUI has replaced it and MAUI can do desktop apps for Windows (using WinUI 3) and Mac (no Linux support), but that isn't the primary focus of MAUI. The primary focus is iOS and Android, so I wouldn't recommend MAUI for desktop either. And that's it unless you count Console apps (which have a HUGE value, but mostly for automation and services). So, what's left standing? WinForms.
@scottstrand7865
@scottstrand7865 26 күн бұрын
@@IAmTimCorey That's great to hear. What are they doing to handle the issues when Windows changed ui rendering. This created havoc on my old winforms projects. This would be (I believe) with the adoption of Windows 7. All my winforms visually scaled poorly and I ended up finding a work around by altering the manifest file. Also, has Microsoft improved Winforms so they can run on other OS', i.e., a Mac (do you know)? Thanks for taking time to answer btw.
@ammulu1966
@ammulu1966 26 күн бұрын
Hi tim, I am receiving internal 500.00 error while running the asp. Net default program through Iis server , I fetched for solution in KZbin but no use, please help me if anyone know this
@jonathanblackwell42
@jonathanblackwell42 26 күн бұрын
Check the event viewer to see what the underlying problem is.
@IAmTimCorey
@IAmTimCorey 26 күн бұрын
A 500 error is a generic error. As @jonathanblackwell42 pointed out, look at event viewer or your application logs to determine what is the actual error.
@KnudNielsen-mv2dt
@KnudNielsen-mv2dt 23 күн бұрын
Is there People’s who write programs in Winform today in 2024 I thought it was Blazor we developed in
@IAmTimCorey
@IAmTimCorey 23 күн бұрын
Remember that we don’t just start out with new apps when joining a company. You typically work on existing applications that have been built over the course of years. Blazor is a great option for new apps, but it is rather new.
My 30+ Tweaks to Visual Studio 2022 - Make VS Work For You
1:02:12
IAmTimCorey
Рет қаралды 28 М.
How did CatNap end up in Luca cartoon?🙀
00:16
LOL
Рет қаралды 5 МЛН
顔面水槽がブサイク過ぎるwwwww
00:58
はじめしゃちょー(hajime)
Рет қаралды 77 МЛН
INO IS A KIND ALIEN😂
00:45
INO
Рет қаралды 22 МЛН
когда одна дома // EVA mash
00:51
EVA mash
Рет қаралды 10 МЛН
I gave 127 interviews. Top 5 Algorithms they asked me.
8:36
Sahil & Sarra
Рет қаралды 574 М.
Stop Using the Worst Way to Loop Lists in .NET!
9:35
Nick Chapsas
Рет қаралды 38 М.
Философия Unsafe Rust
22:35
Bitωise
Рет қаралды 4,5 М.
UI Updates for HTTP Verbs: Building a Postman Clone Course
21:02
IAmTimCorey
Рет қаралды 1,6 М.
If you're not developing with this, you're wasting your time
14:30
Articulated Robotics
Рет қаралды 239 М.
Should I Build a Monolith or Microservices?
15:49
IAmTimCorey
Рет қаралды 8 М.
MVVM vs. MVI - Understand the Difference Once and for All
18:40
Philipp Lackner
Рет қаралды 23 М.
8 await async mistakes that you SHOULD avoid in .NET
21:13
Nick Chapsas
Рет қаралды 306 М.
How did CatNap end up in Luca cartoon?🙀
00:16
LOL
Рет қаралды 5 МЛН