Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Could not find class for token exception when stepping into code #515

@mrward

Description

@mrward

This was reported on the forum.

To reproduce:

  1. Download and unzip this project
  2. Open the project into SharpDevelop 5. Put a breakpoint on the "var ws = new CurrencyConvertor();" line.
  3. Debug the application.
  4. Try to step into the CurrencyConvertor constructor.

Expected result:

SharpDevelop opens CurrencyConverter for the constructor.

Actual result:

SharpDevelop Version : 5.0.0.4526-Beta 5-f2568c1f
.NET Version         : 4.0.30319.34209
OS Version           : Microsoft Windows NT 6.1.7601 Service Pack 1
Current culture      : English (United Kingdom) (en-GB)
Running under WOW6432, processor architecture: x86-64
Working Set Memory   : 199932kb
GC Heap Memory       : 58508kb

Exception thrown:
System.InvalidOperationException: Could not find class for token 33554441
   at Debugger.TypeSystemExtensions.Import(ICompilation compilation, ICorDebugFunction corFunction) in src\AddIns\Debugger\Debugger.Core\TypeSystemExtensions.cs:line 538
   at Debugger.TypeSystemExtensions.Import(ICompilation compilation, ICorDebugFunction corFunction, List`1 typeArgs) in src\AddIns\Debugger\Debugger.Core\TypeSystemExtensions.cs:line 515
   at Debugger.StackFrame..ctor(Thread thread, ICorDebugILFrame corILFrame, UInt32 chainIndex, UInt32 frameIndex) in src\AddIns\Debugger\Debugger.Core\StackFrame.cs:line 86
   at Debugger.Thread.<get_Callstack>d__0.MoveNext() in src\AddIns\Debugger\Debugger.Core\Thread.cs:line 275
   at Debugger.Thread.get_MostRecentStackFrame() in src\AddIns\Debugger\Debugger.Core\Thread.cs:line 336
   at Debugger.ManagedCallback.StepComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugStepper pStepper, CorDebugStepReason reason) in src\AddIns\Debugger\Debugger.Core\ManagedCallback.cs:line 149
   at Debugger.ManagedCallbackSwitch.StepComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugStepper pStepper, CorDebugStepReason reason) in src\AddIns\Debugger\Debugger.Core\ManagedCallbackSwitch.cs:line 130
   at Debugger.ManagedCallbackProxy.<>c__DisplayClass1.<StepComplete>b__0() in src\AddIns\Debugger\Debugger.Core\ManagedCallbackProxy.cs:line 62
   at Debugger.MTA2STA.<>c__DisplayClass4.<EnqueueCall>b__1() in src\AddIns\Debugger\Debugger.Core\Interop\MTA2STA.cs:line 48
   at Debugger.MTA2STA.PerformCall() in src\AddIns\Debugger\Debugger.Core\Interop\MTA2STA.cs:line 98
   at Debugger.MTA2STA.PerformAllCalls() in src\AddIns\Debugger\Debugger.Core\Interop\MTA2STA.cs:line 75
   at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
   at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
   at System.Windows.Forms.Control.InvokeMarshaledCallbacks()

---- Recent log messages:
11:24:52.345 [1] INFO - Open file slnWebServiceShell\slnWebServiceShell\Program.cs
11:24:52.388 [1] INFO - Evaluated node 'args' in 14 ms
11:24:52.391 [1] INFO - Evaluated node 'ws' in 1 ms
11:24:52.394 [1] INFO - Evaluated node 'input' in 3 ms
11:24:52.395 [1] INFO - Evaluated node 'output' in 0 ms
11:24:52.397 [1] INFO - Evaluated node 'result' in 1 ms
11:24:52.865 [8] DEBUG - Resolved (Line 21, Col 4) to [TypeResolveResult net.webservices.CurrencyConvertor]
11:24:52.901 [1] DEBUG - Resolved (Line 18, Col 4) to 
11:24:52.901 [1] DEBUG - Resolved (Line 18, Col 4) to 
11:24:53.564 [1] DEBUG - Resolved (Line 17, Col 28) to [TypeResolveResult System.String]
11:24:53.565 [1] DEBUG - Resolved (Line 17, Col 28) to [TypeResolveResult System.String]
11:24:55.107 [1] INFO - Debugger Command: StepInto
11:24:57.422 [1] DEBUG - Resolved (Line 20, Col 21) to 
11:24:58.127 [1] DEBUG - Resolved (Line 22, Col 4) to 
11:24:59.913 [1] DEBUG - Resolved (Line 22, Col 4) to 
11:25:00.599 [1] DEBUG - Resolved (Line 22, Col 4) to 
11:25:01.676 [6] DEBUG - Telling worker process to exit
11:25:01.676 [6] DEBUG - Waiting for thread-join
11:25:01.677 [14] DEBUG - Cannot read from WorkerProcess 812: end of stream
11:25:01.679 [14] DEBUG - Stopped reading from WorkerProcess 812.
11:25:01.682 [14] DEBUG - Telling worker process to exit
11:25:01.682 [14] DEBUG - End of reader thread on WorkerProcess 812.
11:25:01.683 [6] DEBUG - Joined!
11:25:03.453 [1] DEBUG - Resolved (Line 29, Col 6) to 
11:25:11.929 [1] ERROR - ThreadException caught
--> Exception:
System.InvalidOperationException: Could not find class for token 33554441
   at Debugger.TypeSystemExtensions.Import(ICompilation compilation, ICorDebugFunction corFunction) in src\AddIns\Debugger\Debugger.Core\TypeSystemExtensions.cs:line 538
   at Debugger.TypeSystemExtensions.Import(ICompilation compilation, ICorDebugFunction corFunction, List`1 typeArgs) in src\AddIns\Debugger\Debugger.Core\TypeSystemExtensions.cs:line 515
   at Debugger.StackFrame..ctor(Thread thread, ICorDebugILFrame corILFrame, UInt32 chainIndex, UInt32 frameIndex) in src\AddIns\Debugger\Debugger.Core\StackFrame.cs:line 86
   at Debugger.Thread.<get_Callstack>d__0.MoveNext() in src\AddIns\Debugger\Debugger.Core\Thread.cs:line 275
   at Debugger.Thread.get_MostRecentStackFrame() in src\AddIns\Debugger\Debugger.Core\Thread.cs:line 336
   at Debugger.ManagedCallback.StepComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugStepper pStepper, CorDebugStepReason reason) in src\AddIns\Debugger\Debugger.Core\ManagedCallback.cs:line 149
   at Debugger.ManagedCallbackSwitch.StepComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugStepper pStepper, CorDebugStepReason reason) in src\AddIns\Debugger\Debugger.Core\ManagedCallbackSwitch.cs:line 130
   at Debugger.ManagedCallbackProxy.<>c__DisplayClass1.<StepComplete>b__0() in src\AddIns\Debugger\Debugger.Core\ManagedCallbackProxy.cs:line 62
   at Debugger.MTA2STA.<>c__DisplayClass4.<EnqueueCall>b__1() in src\AddIns\Debugger\Debugger.Core\Interop\MTA2STA.cs:line 48
   at Debugger.MTA2STA.PerformCall() in src\AddIns\Debugger\Debugger.Core\Interop\MTA2STA.cs:line 98
   at Debugger.MTA2STA.PerformAllCalls() in src\AddIns\Debugger\Debugger.Core\Interop\MTA2STA.cs:line 75
   at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
   at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
   at System.Windows.Forms.Control.InvokeMarshaledCallbacks()

---- Post-error application state information:
Installed 3rd party AddIns: 
ProjectService.CurrentSolution: [Solution slnWebServiceShell\slnWebServiceShell.sln with 1 projects]
ProjectService.CurrentProject: [CSharpProject: PnsWebServiceShell]
Workbench.ActiveContent: [AvalonEditViewContent slnWebServiceShell\slnWebServiceShell\Program.cs]

With SharpDevelop 5 you can put a breakpoint in the CurrencyConverter constructor and that will be hit by the debugger.

With SharpDevelop 4 when you try to step into the constructor the debugger does not go into the constructor but continues in the Program.cs file but does not throw an exception. SharpDevelop 4 does not hit a breakpoint in the CurrencyConverter constructor.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions