Hi im trying to load a dll file and always get this exception:

Here the code:

var assemblyDef = AssemblyFactory.GetAssembly(@"C:\Users\Roflcoptr
\Documents\Visual Studio 2008\Projects
\Prototype_Ver1\Prototype_Ver1\bin\Debug\hello_cs.dll");
                assemblyDef.MainModule.LoadSymbols();

Any hints how to changed that?

System.Reflection.TargetInvocationException was unhandled
  Message=Exception has been thrown by the target of an invocation.
  Source=mscorlib
  StackTrace:
       at System.RuntimeMethodHandle._InvokeMethodFast(Object target,
Object[] arguments, SignatureStruct& sig, MethodAttributes
methodAttributes, RuntimeTypeHandle typeOwner)
       at System.RuntimeMethodHandle.InvokeMethodFast(Object target,
Object[] arguments, Signature sig, MethodAttributes methodAttributes,
RuntimeTypeHandle typeOwner)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters,
CultureInfo culture, Boolean skipVisibilityChecks)
       at System.Delegate.DynamicInvokeImpl(Object[] args)
       at
Microsoft.Surface.Shell.ApiEventManager.EventSubscriberInfo.InvokeCallback(Object
arg)
       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 Prototype_Ver1.App.Main() in C:\Users\Roflcoptr\Documents
\Visual Studio 2008\Projects\Prototype_Ver1\Prototype_Ver1\obj\Debug
\App.g.cs:line 0
       at System.AppDomain._nExecuteAssembly(Assembly assembly,
String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile,
Evidence assemblySecurity, String[] args)
       at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object
state)
       at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.Runtime.InteropServices.COMException
       Message=ExceptionOccurred
       Source=ISymWrapper
       ErrorCode=-2140340204
       StackTrace:
            at
System.Diagnostics.SymbolStore.SymBinder.GetReader(IntPtr importer,
String filename, String searchPath)
            at Mono.Cecil.Pdb.PdbHelper.InstantiateReader(SymBinder
binder, String filename, Object objImporter)
            at Mono.Cecil.Pdb.PdbHelper.CreateReader(String filename)
            at Mono.Cecil.Pdb.PdbFactory.CreateReader(ModuleDefinition
module, String assemblyFileName)
            at
Mono.Cecil.Cil.SymbolStoreHelper.GetReader(ModuleDefinition module)
            at Mono.Cecil.ModuleDefinition.LoadSymbols()
            at
Prototype_Ver1.SurfaceWindow1.OnApplicationActivated(Object sender,
EventArgs e) in C:\Users\Roflcoptr\Documents\Visual Studio
2008\Projects\Prototype_Ver1\Prototype_Ver1\MainWindow.xaml.cs:line 96
       InnerException:

-- 
--
mono-cecil

Reply via email to