为什么要“优化代码”需要打开我的程序才能运行而不崩溃吗?
我得到了这个 WPF 应用程序,当我尝试在调试模式下运行该程序时,它会在进入 Windows1.xml 之前崩溃。后来我尝试在发布模式下运行,它可以成功运行。我将范围缩小到这一点,我需要打开“优化代码”才能使其工作。
注意:断点、从调试单步执行以及抛出异常时停止不起作用。
编辑: 异常是 WPF(非常流行且无帮助)通用异常:
{“无法创建程序集“VCell2,Version=1.0.0.0,Culture=neutral,PublicKeyToken=null”中定义的“Main”实例。调用目标已引发异常。标记文件“Window1”中出现错误.xaml' 第 1 行位置 9。"} 来源=“演示框架” 行号=1 LinePosition=9
编辑: 内部 - 内部异常: {“找不到指定的模块。(HRESULT异常:0x8007007E)”:null}
这是我得到的堆栈跟踪:
at System.Windows.Markup.XamlParseException.ThrowException(String message, Exception innerException, Int32 lineNumber, Int32 linePosition, Uri baseUri, XamlObjectIds currentXamlObjectIds, XamlObjectIds contextXamlObjectIds, Type objectType)
at System.Windows.Markup.XamlParseException.ThrowException(ParserContext parserContext, Int32 lineNumber, Int32 linePosition, String message, Exception innerException)
at System.Windows.Markup.BamlRecordReader.ThrowExceptionWithLine(String message, Exception innerException)
at System.Windows.Markup.BamlRecordReader.CreateInstanceFromType(Type type, Int16 typeId, Boolean throwOnFail)
at System.Windows.Markup.BamlRecordReader.GetElementAndFlags(BamlElementStartRecord bamlElementStartRecord, Object& element, ReaderFlags& flags, Type& delayCreatedType, Int16& delayCreatedTypeId)
at System.Windows.Markup.BamlRecordReader.BaseReadElementStartRecord(BamlElementStartRecord bamlElementRecord)
at System.Windows.Markup.BamlRecordReader.ReadElementStartRecord(BamlElementStartRecord bamlElementRecord)
at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord)
at System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord)
at System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment()
at System.Windows.Markup.TreeBuilder.Parse()
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc)
at System.Windows.Application.LoadComponent(Uri resourceLocator, Boolean bSkipJournaledProperties)
at System.Windows.Application.DoStartup()
at System.Windows.Application.<.ctor>b__0(Object unused)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at VCell2.App.Main() in C:\Users\wandrus\Documents\Visual Studio 2008\Projects\VCell2\VCell2\obj\Debug\App.g.cs:line 0
编辑我尝试运行它windbg(不知道如果我做得正确的话)
ModLoad: 77310000 773b0000 C:\Windows\system32\ADVAPI32.dll
ModLoad: 76a30000 76adc000 C:\Windows\system32\msvcrt.dll
ModLoad: 76c60000 76c79000 C:\Windows\SYSTEM32\sechost.dll
ModLoad: 76ae0000 76b82000 C:\Windows\system32\RPCRT4.dll
ModLoad: 770c0000 77117000 C:\Windows\system32\SHLWAPI.dll
ModLoad: 76940000 7698e000 C:\Windows\system32\GDI32.dll
ModLoad: 76c80000 76d49000 C:\Windows\system32\USER32.dll
ModLoad: 778e0000 778ea000 C:\Windows\system32\LPK.dll
ModLoad: 77120000 771bd000 C:\Windows\system32\USP10.dll
ModLoad: 76ea0000 76ebf000 C:\Windows\system32\IMM32.DLL
ModLoad: 76b90000 76c5c000 C:\Windows\system32\MSCTF.dll
ModLoad: 6c1b0000 6c1b5000 C:\Windows\system32\avgrsstx.dll
ModLoad: 57310000 578a1000 C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
ModLoad: 756a0000 7573b000 C:\Windows\WinSxS\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4918_none_d089094c442eb5ff\MSVCR80.dll
ModLoad: 75c40000 76886000 C:\Windows\system32\shell32.dll
ModLoad: 773c0000 7751b000 C:\Windows\system32\ole32.dll
ModLoad: 75810000 7581b000 C:\Windows\system32\profapi.dll
ModLoad: 53de0000 548d8000 C:\Windows\assembly\NativeImages_v2.0.50727_32\mscorlib\70603943245265de9397091048337dda\mscorlib.ni.dll
ModLoad: 757a0000 757ac000 C:\Windows\system32\CRYPTBASE.dll
ModLoad: 744f0000 74530000 C:\Windows\system32\uxtheme.dll
ModLoad: 52ea0000 53639000 C:\Windows\assembly\NativeImages_v2.0.50727_32\System\ade9214f5bce88462742bce1278864c0\System.ni.dll
ModLoad: 57ae0000 57e0c000 C:\Windows\assembly\NativeImages_v2.0.50727_32\WindowsBase\c7663f3a74fb6aa480c60108634d285a\WindowsBase.ni.dll
ModLoad: 03eb0000 04a5b000 C:\Windows\assembly\NativeImages_v2.0.50727_32\PresentationCore\c79b7f336e6099b8c94081f975e9411e\PresentationCore.ni.dll
ModLoad: 55240000 55fec000 C:\Windows\assembly\NativeImages_v2.0.50727_32\PresentationFramewo#\7d80b7d912fbf0f7532f1b9adc235646\PresentationFramework.ni.dll
ModLoad: 00e50000 01255000 PresentationCore.dll
ModLoad: 00e50000 01255000 PresentationCore.dll
ModLoad: 539d0000 53b7c000 C:\Windows\Microsoft.NET\Framework\v3.0\WPF\wpfgfx_v0300.dll
ModLoad: 76990000 76a1f000 C:\Windows\system32\OLEAUT32.dll
ModLoad: 51520000 51754000 C:\Windows\assembly\NativeImages_v2.0.50727_32\System.Core\e78709bedd31f237055667ad99b9451f\System.Core.ni.dll
ModLoad: 6cbc0000 6cc1b000 C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorjit.dll
ModLoad: 637d0000 638c1000 C:\Windows\assembly\NativeImages_v2.0.50727_32\System.Configuration\9c2727d244dcc72fbefcf1ae22660f35\System.Configuration.ni.dll
ModLoad: 57f20000 58456000 C:\Windows\assembly\NativeImages_v2.0.50727_32\System.Xml\93d38ea87365928456313035f8091126\System.Xml.ni.dll
ModLoad: 74130000 74143000 C:\Windows\system32\dwmapi.dll
ModLoad: 60340000 60348000 C:\Windows\Microsoft.NET\Framework\v2.0.50727\culture.dll
(1e2c.738): C++ EH exception - code e06d7363 (first chance)
(1e2c.738): C++ EH exception - code e06d7363 (first chance)
(1e2c.738): C++ EH exception - code e06d7363 (first chance)
(1e2c.738): C++ EH exception - code e06d7363 (first chance)
(1e2c.738): C++ EH exception - code e06d7363 (first chance)
(1e2c.738): C++ EH exception - code e06d7363 (first chance)
(1e2c.738): C++ EH exception - code e06d7363 (first chance)
(1e2c.738): CLR exception - code e0434f4d (first chance)
(1e2c.738): C++ EH exception - code e06d7363 (first chance)
(1e2c.738): CLR exception - code e0434f4d (first chance)
(1e2c.738): CLR exception - code e0434f4d (first chance)
(1e2c.738): CLR exception - code e0434f4d (first chance)
(1e2c.738): CLR exception - code e0434f4d (!!! second chance !!!)
eax=0025e034 ebx=e0434f4d ecx=00000001 edx=00000000 esi=0025e0bc edi=002d66d8
eip=75acb4f4 esp=0025e034 ebp=0025e084 iopl=0 nv up ei pl nz ac po nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000212
*** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\Windows\system32\KERNELBASE.dll -
KERNELBASE!RaiseException+0x54:
75acb4f4 c9 leave
I was given this WPF application, when I tried to run the program in Debug mode it would crash before getting to Windows1.xml. I later tried running in Release Mode and it would run successfully. I narrowed it down to that, I needed to turn on "Optimize Code" for it to work.
Note: Breakpoints, stepping into from debug, and stopping on throw exceptions don't work.
Edit: The exception was WPF (very popular & not helpful) generic exception:
{"Cannot create instance of 'Main' defined in assembly 'VCell2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Exception has been thrown by the target of an invocation. Error in markup file 'Window1.xaml' Line 1 Position 9."}
Source="PresentationFramework"
LineNumber=1
LinePosition=9
Edit: The inner - inner exception:
{"The specified module could not be found. (Exception from HRESULT: 0x8007007E)":null}
Here was the stack trace I was getting:
at System.Windows.Markup.XamlParseException.ThrowException(String message, Exception innerException, Int32 lineNumber, Int32 linePosition, Uri baseUri, XamlObjectIds currentXamlObjectIds, XamlObjectIds contextXamlObjectIds, Type objectType)
at System.Windows.Markup.XamlParseException.ThrowException(ParserContext parserContext, Int32 lineNumber, Int32 linePosition, String message, Exception innerException)
at System.Windows.Markup.BamlRecordReader.ThrowExceptionWithLine(String message, Exception innerException)
at System.Windows.Markup.BamlRecordReader.CreateInstanceFromType(Type type, Int16 typeId, Boolean throwOnFail)
at System.Windows.Markup.BamlRecordReader.GetElementAndFlags(BamlElementStartRecord bamlElementStartRecord, Object& element, ReaderFlags& flags, Type& delayCreatedType, Int16& delayCreatedTypeId)
at System.Windows.Markup.BamlRecordReader.BaseReadElementStartRecord(BamlElementStartRecord bamlElementRecord)
at System.Windows.Markup.BamlRecordReader.ReadElementStartRecord(BamlElementStartRecord bamlElementRecord)
at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord)
at System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord)
at System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment()
at System.Windows.Markup.TreeBuilder.Parse()
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc)
at System.Windows.Application.LoadComponent(Uri resourceLocator, Boolean bSkipJournaledProperties)
at System.Windows.Application.DoStartup()
at System.Windows.Application.<.ctor>b__0(Object unused)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at VCell2.App.Main() in C:\Users\wandrus\Documents\Visual Studio 2008\Projects\VCell2\VCell2\obj\Debug\App.g.cs:line 0
Edit I've tried running it windbg (don't know if I'm doing this correctly)
ModLoad: 77310000 773b0000 C:\Windows\system32\ADVAPI32.dll
ModLoad: 76a30000 76adc000 C:\Windows\system32\msvcrt.dll
ModLoad: 76c60000 76c79000 C:\Windows\SYSTEM32\sechost.dll
ModLoad: 76ae0000 76b82000 C:\Windows\system32\RPCRT4.dll
ModLoad: 770c0000 77117000 C:\Windows\system32\SHLWAPI.dll
ModLoad: 76940000 7698e000 C:\Windows\system32\GDI32.dll
ModLoad: 76c80000 76d49000 C:\Windows\system32\USER32.dll
ModLoad: 778e0000 778ea000 C:\Windows\system32\LPK.dll
ModLoad: 77120000 771bd000 C:\Windows\system32\USP10.dll
ModLoad: 76ea0000 76ebf000 C:\Windows\system32\IMM32.DLL
ModLoad: 76b90000 76c5c000 C:\Windows\system32\MSCTF.dll
ModLoad: 6c1b0000 6c1b5000 C:\Windows\system32\avgrsstx.dll
ModLoad: 57310000 578a1000 C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
ModLoad: 756a0000 7573b000 C:\Windows\WinSxS\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4918_none_d089094c442eb5ff\MSVCR80.dll
ModLoad: 75c40000 76886000 C:\Windows\system32\shell32.dll
ModLoad: 773c0000 7751b000 C:\Windows\system32\ole32.dll
ModLoad: 75810000 7581b000 C:\Windows\system32\profapi.dll
ModLoad: 53de0000 548d8000 C:\Windows\assembly\NativeImages_v2.0.50727_32\mscorlib\70603943245265de9397091048337dda\mscorlib.ni.dll
ModLoad: 757a0000 757ac000 C:\Windows\system32\CRYPTBASE.dll
ModLoad: 744f0000 74530000 C:\Windows\system32\uxtheme.dll
ModLoad: 52ea0000 53639000 C:\Windows\assembly\NativeImages_v2.0.50727_32\System\ade9214f5bce88462742bce1278864c0\System.ni.dll
ModLoad: 57ae0000 57e0c000 C:\Windows\assembly\NativeImages_v2.0.50727_32\WindowsBase\c7663f3a74fb6aa480c60108634d285a\WindowsBase.ni.dll
ModLoad: 03eb0000 04a5b000 C:\Windows\assembly\NativeImages_v2.0.50727_32\PresentationCore\c79b7f336e6099b8c94081f975e9411e\PresentationCore.ni.dll
ModLoad: 55240000 55fec000 C:\Windows\assembly\NativeImages_v2.0.50727_32\PresentationFramewo#\7d80b7d912fbf0f7532f1b9adc235646\PresentationFramework.ni.dll
ModLoad: 00e50000 01255000 PresentationCore.dll
ModLoad: 00e50000 01255000 PresentationCore.dll
ModLoad: 539d0000 53b7c000 C:\Windows\Microsoft.NET\Framework\v3.0\WPF\wpfgfx_v0300.dll
ModLoad: 76990000 76a1f000 C:\Windows\system32\OLEAUT32.dll
ModLoad: 51520000 51754000 C:\Windows\assembly\NativeImages_v2.0.50727_32\System.Core\e78709bedd31f237055667ad99b9451f\System.Core.ni.dll
ModLoad: 6cbc0000 6cc1b000 C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorjit.dll
ModLoad: 637d0000 638c1000 C:\Windows\assembly\NativeImages_v2.0.50727_32\System.Configuration\9c2727d244dcc72fbefcf1ae22660f35\System.Configuration.ni.dll
ModLoad: 57f20000 58456000 C:\Windows\assembly\NativeImages_v2.0.50727_32\System.Xml\93d38ea87365928456313035f8091126\System.Xml.ni.dll
ModLoad: 74130000 74143000 C:\Windows\system32\dwmapi.dll
ModLoad: 60340000 60348000 C:\Windows\Microsoft.NET\Framework\v2.0.50727\culture.dll
(1e2c.738): C++ EH exception - code e06d7363 (first chance)
(1e2c.738): C++ EH exception - code e06d7363 (first chance)
(1e2c.738): C++ EH exception - code e06d7363 (first chance)
(1e2c.738): C++ EH exception - code e06d7363 (first chance)
(1e2c.738): C++ EH exception - code e06d7363 (first chance)
(1e2c.738): C++ EH exception - code e06d7363 (first chance)
(1e2c.738): C++ EH exception - code e06d7363 (first chance)
(1e2c.738): CLR exception - code e0434f4d (first chance)
(1e2c.738): C++ EH exception - code e06d7363 (first chance)
(1e2c.738): CLR exception - code e0434f4d (first chance)
(1e2c.738): CLR exception - code e0434f4d (first chance)
(1e2c.738): CLR exception - code e0434f4d (first chance)
(1e2c.738): CLR exception - code e0434f4d (!!! second chance !!!)
eax=0025e034 ebx=e0434f4d ecx=00000001 edx=00000000 esi=0025e0bc edi=002d66d8
eip=75acb4f4 esp=0025e034 ebp=0025e084 iopl=0 nv up ei pl nz ac po nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000212
*** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\Windows\system32\KERNELBASE.dll -
KERNELBASE!RaiseException+0x54:
75acb4f4 c9 leave
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要提供更多信息。什么是例外?可能是在运行时引用了无法解析的类型。如果代码没有被使用,优化器可能会从 JIT 中忽略它,而在调试模式下它可能会触发类型加载异常。谁知道呢。如果没有更多信息,就无法判断。
编辑响应您问题中的更新,似乎有一种名为 Main 的类型在其实例构造函数或静态构造函数中引发异常。它也可能是触发此事件的字段初始值设定项。如果您可以捕获该异常,请检查其通常包含TargetInitationExceptions 的InnerException。这将为您提供更多信息。
编辑您已经指出内部异常是程序集加载问题,这正是我最初想到的。所以你在某处缺少参考。特别是,您可能引用一个 DLL,而该 DLL 又引用另一个无法定位的 DLL。您需要找出无法解析哪个程序集。您可以使用 fuslogvw.exe 工具来查看程序集绑定错误。
You need to provide more information. What is the exception? It could be that a type is being referenced at runtime that can't be resolved. If the code isn't being used, the optimizer might just omit it from JIT whereas in debug mode it could be triggering a type load exception. Who knows though. Without more info it'd be impossible to tell.
edit in response to the update in your question, it seems like there's a type called Main that is throwing an exception in its instance constructor or static constructor. It could also be a field initializer that's triggering this. If you can catch the exception, check its InnerException which TargetInvocationExceptions usually contain. This will give you more info.
edit you've indicated that the inner exception is an assembly loading problem which is what i figured initially. so you're missing a reference somewhere. in particular, you are probably referencing a DLL that in turn references another DLL that cannot be located. You'll need to figure out which assembly can't be resolved. You can use the fuslogvw.exe tool to view assembly binding errors.