问题描述
我有一个引用了WPF控件库的WPF应用程序。当我尝试启动(myWindow.Show())控件库中的窗口时,出现以下异常:
I've got a WPF application that references a WPF controls library. When I try to launch (myWindow.Show()) a window that is inside the control library, I get the following exception:
奇怪的是,我不是 正在执行ClickOnce应用程序,为什么会抱怨呢?
The bizarre thing is that I'm not doing a ClickOnce application, so why is it complaining about this?
推荐答案
您没有说这是否在VS调试器,但是...
You didn't say whether this was under the VS debugger, but...
我今天从将控件的ImageSource设置为BitmapImage(someURI)的代码中得到了这个。代码一直运行良好,直到我意识到出于其他原因我不得不告诉调试器打破CLR异常后,我才感到困惑。因此,我取消选中System.Deployment子类别的异常,并且我的代码再次完美运行。 MS在内部使用异常系统来处理我不需关心的案件,这有点痛苦。
I was getting this one today from code that set a control's ImageSource to be a BitmapImage(someURI). The code had been working perfectly, and I was puzzled until I realized that I had for other reasons just told the debugger to break on CLR exceptions. So I unchecked the System.Deployment subcategory of exceptions, and my code once again ran perfectly. Kind of a pain that MS uses the exception system internally to handle cases that I shouldn't have to care about.
这篇关于InvalidDeploymentException-未设置应用程序身份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!