Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Auto generated view.g.cs page keeps including old using statements?

Tags:

wpf

xaml

I'm having a pretty difficult time with my resources within the view pages.

The auto generated view.g.cs page keeps including old using statements and I can't get it to stop. I have about 12 views and it will only do it on the first one, but then I delete that file completely and it then adds them to the next view. I've tried recreating the views and but the first one with the generated file still fails. I then set the build option to none, cleaned, rebuilt, and back to page, and it still happens!

I've tried deleting the actual generated files in the obj folder but they just get created again and the first view in my list then screws up again.

Any way around this? I think I've exhausted my options other then recreating the project but I'd prefer not to do this. Any other way to fix the generated files?

Cheers.

like image 543
bl4kh4k Avatar asked Oct 25 '25 06:10

bl4kh4k


1 Answers

Try right-clicking on the XAML file and "Run custom tool".

This should generate the new, up-to-date .q.cs files.

EDIT:

Also, make sure that your own XAML and code-behind file is correct. The best way to do this is to perform a recursive search for the old namespace in all the files . in project directory (most appropiate part of it, for example: com.company.product.OldNameOfFeature - search for OldNameOfFeature). If there are any XAML or code files you'll need to fix them.

EDIT 2

This search should be done using external application outside Visual Studio, for example TotalCommander.

How to search in TotalCommander:

enter image description here

like image 110
surfen Avatar answered Oct 28 '25 04:10

surfen