Remove an old namespace from a g.cs File?

I had a local reference to the Controls namespace in my Xaml code (MainWindow.xaml). I removed the reference, cleaned the project and produced a successful build.


In your user control file,

In your ClassName.xaml, you must change the namespace as shown below

<UserControl
    x:Class="YourOldNamespace.ClassName"
    ...
    ...
/>

And in your ClassName.xaml.cs, you must change the namespace as shown below

using System;
using System.Windows;

namespace YourOldNamespace{

   public class ClassName{ ....

}

In both the files, you must replace YourOldNamespace to some new namespace as needed.