xsharp.eu • InitializeComponent problem
Page 1 of 1

InitializeComponent problem

Posted: Thu Oct 29, 2020 7:45 pm
by AlwynJB
Hi all,
I thought I had retired (80 last week but no proper celebration due to COVID-19)!
However, I had to change old code and I have an interesting problem. Several, but not all, windows in my App cause "The name 'InitializeComponent' does not exist in current context" error to be listed. This of course causes other compilation errors too.
For some reason my Solution does not include a .xsproj file though it does include a .xsproj.backup file. I'm guessing this is the problem. However the .xsproj file does exist in the File Explorer but I can't import it. A message says that it does exist but that I can't edit it. Is there a way to convert the backup file to a 'real' file?
I see that this error message is not unknown to C# programs. I have checked out the recommended corrections but they made no mention of a .csproj file being absent from the solution.
What to do? I am still using VS 2015 Community version and an X# beta version. Should I update them? Would that help? Stupidly I don't have a recent backup!!!!
I trust the team members are all well.
Best wishes to all,
Alwyn

InitializeComponent problem

Posted: Fri Oct 30, 2020 6:58 am
by Chris
Hi Alwyn,

Happy Birthday and glad to hear from you again after some time!

About the problem you reported, if there was no .xsproj file, your app would not be loading at all, so there's something else going on. Can you please zip the whole solution folder and post it here so we can have a look? If it contains sensitive code/dats, please send it directly to me.

InitializeComponent problem

Posted: Fri Oct 30, 2020 10:19 am
by NickFriend
Hi Alwyn,

Happy Birthday!

Just a thought, assuming this is WPF, it could be that the class name or namespace is wrong in the associated xaml file.

HTH

Nick

InitializeComponent problem

Posted: Fri Oct 30, 2020 3:13 pm
by ic2
Hello Alwyn,

Good to hear from you again and congratulations!

Apart from this issue I would recommend to go to VS 2019 Community. They have added one useful thing since 2015 (perhaps more but I can't remember anything else worth mentioning ;) Code Lense. This directly shows if a method is called and you can track back the calling method with 1 click.

In VO you have to search for that so that's then 1 feature VS is better then VO!

Dick

InitializeComponent problem

Posted: Sat Oct 31, 2020 9:51 pm
by Otto
wow, you are blessed that you are able to do this kind of things. Congratulations and God bless you

InitializeComponent problem

Posted: Sun Nov 01, 2020 2:46 pm
by TerryB1
Hello Alwyn

Good to see you here. Happy Birthday.

Your "Summer Triangle" Book (which didn't fall apart), is still on my bookshelf.

Hard to believe that was a last century publication!

All the best

Terry