C
C#4mo ago
Camster

✅ Winforms Forms converted to just c# classes

I updated visual studio this week to the latest version, and now in my winforms project all my forms are just c# classes. I don't know how to get to the UI designer.
No description
27 Replies
leowest
leowest4mo ago
can u show the content of one of those cs files
Camster
Camster4mo ago
Yes. It seems to have all the form components like before
No description
Camster
Camster4mo ago
But when I double-click it, it just opens the cs file
Petris
Petris4mo ago
I had this issue like a week ago but I don't remember how I fixed it tbh
leowest
leowest4mo ago
I know how to fix it but I need to see one of those files to confirm my suspicious usually that happens when you add classes and stuff before the form class
Camster
Camster4mo ago
One of the cs files?
Petris
Petris4mo ago
it was purely a VS issue in my case
leowest
leowest4mo ago
yes for example the content of ChapterForm.cs
Camster
Camster4mo ago
No description
Camster
Camster4mo ago
Yeah, has to be a VS issue. This was working just before I updated.
leowest
leowest4mo ago
well its not recognizing Form in your code for some reason
Camster
Camster4mo ago
Yeah, totally weird
leowest
leowest4mo ago
can u post your csproj?
Camster
Camster4mo ago
Yeah
No description
leowest
leowest4mo ago
yeah so what I Have seen before it people add say a class before the : Form line and it break the designer which is not your case
Camster
Camster4mo ago
whoa It just fixed by itself
leowest
leowest4mo ago
lol could have been just $vsdrunk
MODiX
MODiX4mo ago
* close VS * remove the hidden folder .vs * remove all bin and obj folder next to each csproj (DO NOT TOUCH THE .git FOLDER OR WHAT'S INSIDE) * restart vs
Camster
Camster4mo ago
I hit the enter key in the class, and then they all returned to the normal form icon lol
leowest
leowest4mo ago
where did u hit enter
Camster
Camster4mo ago
Just added a new line after the namespace
No description
Camster
Camster4mo ago
And then, poof. It's working now. lol
leowest
leowest4mo ago
mmm I wonder if for some funky reason the lack of space there was making it confuse
Camster
Camster4mo ago
Dunno, it fixed it for all my other files too. Must've just been a hiccup. Thank you for the help! 🙂
leowest
leowest4mo ago
hey we didnt do anything all on you 😉 $close
MODiX
MODiX4mo ago
If you have no further questions, please use /close to mark the forum thread as answered
Petris
Petris4mo ago
yeah it was something like that in my case too i don't remember what it was exactly though but removing .vs didn't help either or git clean -fdx to be exact
Want results from more Discord servers?
Add your server