InitializeComponent problem

This forum is meant for questions and discussions about the X# language and tools
Post Reply
User avatar
AlwynJB
Posts: 31
Joined: Tue Jan 17, 2017 2:25 pm

InitializeComponent problem

Post 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
User avatar
Chris
Posts: 4913
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

InitializeComponent problem

Post 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.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
NickFriend
Posts: 248
Joined: Fri Oct 14, 2016 7:09 am

InitializeComponent problem

Post 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
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

InitializeComponent problem

Post 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
User avatar
Otto
Posts: 174
Joined: Wed Sep 30, 2015 6:22 pm

InitializeComponent problem

Post by Otto »

wow, you are blessed that you are able to do this kind of things. Congratulations and God bless you
TerryB1
Posts: 306
Joined: Wed Jan 03, 2018 11:58 am

InitializeComponent problem

Post 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
Post Reply