Alex Rivera | Logout

Old namespace still in .g.cs file when changing namespace of a referenced class

Asked 2011-01-26T11:46:01.373
13

I have renamed the namespace of a referenced class and WPF compiler doesn't want to take it into account: it keeps prefixing MyOldNameSpace in .g.cs file:

[System.CodeDom.Compiler.GeneratedCodeAttribute
     ("PresentationBuildTasks", "4.0.0.0")]
public partial class MyClass: 
    MyOldNameSpace.MyReferencedClass, 
    System.Windows.Markup.IComponentConnector {

Why ? How to fix this ? What's this obscure .g.cs file ?

wpf
Edit
Report

1 Answer

22

Looks like you didn't change your MyClass.xaml file. There should be something like this on top of it

<MyClass x:Class="MyOldNameSpace.MyReferencedClass"

but should be "MyNewNameSpace.MyReferencedClass"

answered 2011-01-26T11:55:37.043

Your Answer