After changing namespace in UserControl files, …g.cs files get errors

前端 未结 6 1257
陌清茗
陌清茗 2021-02-18 18:54

I copied three classes in from another WPF project and then changed their namespaces.

Now when I run the project, I get errors in the \".g.cs\"

6条回答
  •  情话喂你
    2021-02-18 19:15

    I had defined XML namespace shortcuts in my AssemblyInfo.cs

    [assembly: XmlnsDefinition("http://www.example.com/wpf", "MyCorp.Wpf.OldNamespace")]
    

    where the old namespace was still present. Searching through all my *.xaml files obviously did not help …

    After fixing the shortcuts, the error went away immediately.

提交回复
热议问题