问题遇到的现象和发生背景
VisualStudio2019用WPF写的一个界面,里面的项目树是用winform后期加载到Xmal上的,Debug模式下能编译能运行,Release模式下编译通过运行报错

内容是:
引发的异常:“System.IO.FileNotFoundException”(位于 mscorlib.dll 中)
引发的异常:“System.Reflection.TargetInvocationException”(位于 mscorlib.dll 中)
“PathPlan.exe”(CLR v4.0.30319: PathPlan.exe): 已加载“C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\Remote Debugger\x64\Runtime\Microsoft.VisualStudio.Debugger.Runtime.Desktop.dll”。
引发的异常:“System.Reflection.TargetInvocationException”(位于 mscorlib.dll 中)
“PathPlan.exe”(CLR v4.0.30319: PathPlan.exe): 已加载“C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xaml.resources\v4.0_4.0.0.0_zh-Hans_b77a5c561934e089\System.Xaml.resources.dll”。模块已生成,不包含符号。
引发的异常:“System.Xaml.XamlObjectWriterException”(位于 System.Xaml.dll 中)
引发的异常:“System.Windows.Markup.XamlParseException”(位于 PresentationFramework.dll 中)
对类型“PathPlan.OccViewer”的构造函数执行符合指定的绑定约束的调用时引发了异常。
问题相关代码,请勿粘贴截图
下面是报异常的部分,实际上也不知道是哪里的错
public partial class MainWindow : RibbonWindow
{
BlankSetting BlankSet;
CutterSetting cutter;
static string[] TemName = { };
public MainWindow()
{
InitializeComponent();
treeSetting.Displayobj += new TreeSetting.CallEventHandler(Display_Obj);
treeSetting.Hideobj += new TreeSetting.CallEventHandler(Hide_Obj);
treeSetting.Selectobj += new TreeSetting.CallEventHandler(Select_Obj);
treeSetting.Deleteobj += new TreeSetting.CallEventHandler(Delete_Obj);
}
我的解答思路和尝试过的方法
有朋友可以帮忙给下问题的思路吗