gpt4 book ai didi

wpf - WPF,将XAML文件移动到另一个项目

转载 作者:行者123 更新时间:2023-12-02 10:55:19 26 4
gpt4 key购买 nike

我只是将几个WPF用户控件从一个项目移到了另一个项目,现在在编译时遇到了所有这些错误,据说所有用户控件CodeDom,Windows,Diagnostics和ComponentModel都缺少相同的 namespace

Error   9   The type or namespace name 'CodeDom' does not exist in the namespace 'Brodit.Etikettsystem.Modules.System' (are you missing an assembly reference?) C:\Users\per\Desktop\Etikettsystem\Brodit.Etikettsystem.Modules\obj\Debug\Customers\CustomersView.g.cs  48  17  Brodit.Etikettsystem.Modules
Error 1 The type or namespace name 'Windows' does not exist in the namespace 'Brodit.Etikettsystem.Modules.System' (are you missing an assembly reference?) C:\Users\per\Desktop\Etikettsystem\Brodit.Etikettsystem.Modules\obj\Debug\Customers\CustomersView.g.cs 40 49 Brodit.Etikettsystem.Modules
Error 7 The type or namespace name 'Diagnostics' does not exist in the namespace 'Brodit.Etikettsystem.Modules.System' (are you missing an assembly reference?) C:\Users\per\Desktop\Etikettsystem\Brodit.Etikettsystem.Modules\obj\Debug\Customers\CustomersView.g.cs 47 17 Brodit.Etikettsystem.Modules

移动之后,我更改了所有命名空间以匹配新的项目名称,然后尝试删除obj文件夹并为所有xaml文件运行自定义工具。我应该采取什么措施解决此问题。

最佳答案

这些是.NET Framework namespace 。看起来目标项目中缺少某些WPF和系统库。

您是否尝试过将XAML文件复制到类库项目中?如果是这样,则应将适当的引用添加到目标项目。

另一种可能性是您的项目面向不包含WPF库的.NET Framework 2.0。

大多数System.Windows类(包括Window)在PresentationFramework.dll中定义

关于wpf - WPF,将XAML文件移动到另一个项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13837213/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com