2
Vote

Cannot debug Silverlight unit tests with ReSharper 8

description

Hi,
running Silverlight unit tests works fine, debugging does not. When I debug a test the VS goes to the debug view and hangs up. The wcfSvcHost ist started. To recover from this I have to end the devenv process in the task manager. In the task manager I see the ReSharper Task runner process and three vstest.discoverengine processes.

I am using:
ReSharper: Build 8.0.2000.3073 on 2013-10-29T18:52:18
with Plugins: 2
  1. AgUnit v0.8.0.0 by “AgUnit authors - http://agunit.codeplex.com”
  2. “NuGet support for ReSharper” v1.3.0.9560 by JetBrains
Visual Studio 2012 Premium 11.0.60610.01 Update 3
Dynamics CRM 2013 visual studio plugin installed (if that matters)
Silverlight SDK 4 and 5 installed (German version)
Internet Explorer 11 (changed the registry key "AllowElevatedTrustAppsInBrowser" to 1 if that matters)

I installed the AgUnit with NuGet.

Before I was using ReSharper 7.3 with the corresponding version of AgUnit and debugging Silverlight tests worked fine. Unfortunately I cannot switch back to 7.3, since I only have a Resharper license for version 8.

Thanks in advance for the investigation. If I missed out any information feel free to contact me.
Cheers,
YetAnotherAccount

comments

SDeKock wrote Feb 7, 2014 at 11:07 AM

Hi,

Can you try creating a new solution/project with a single test project with a single test and debug that?
Just to make sure the basics work ...

Steven

YetAnotherAccount wrote Feb 7, 2014 at 1:21 PM

Hi Steven,
I did that and it works fine in the new solution. Even after adding the async NuGet package and FakeItEasy. The cause must be in my solution or configuration. I am currently trying to find the difference between the newly created project and my real one.

Can you give me a hint how I can get more information about the problem?

Cheers,
Arne

SDeKock wrote Feb 7, 2014 at 2:03 PM

Can you start visual studio with these command line arguments:
/ReSharper.LogFile "C:\resharper.log" /ReSharper.LogLevel Verbose

This will create a logfile for ReSharper in C:\resharper.log. Please check if there are any exceptions being logged.

SDeKock wrote Feb 7, 2014 at 2:05 PM

You might also have luck with the internal mode (haven't used it in a while myself):

http://grahamrhay.wordpress.com/2011/10/05/debugging-a-r-unit-test-runner/

YetAnotherAccount wrote Feb 7, 2014 at 3:42 PM

I see a log full of exceptions. Not sure if that is normal. However, I see lots of Exceptions like these:

--- EXCEPTION #1/1 [LoggerException]
Message = “This operation requires a reader lock. Use ReadLockCookie.Execute().”
ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
HResult = COR_E_APPLICATION=80131600
StackTraceString = “
at JetBrains.Application.IShellLocksEx.AssertReadAccessAllowed(IShellLocks thіs) in c:\BuildAgent\work\33fb4a13d5bb6cc2\Platform\src\Shell\src\Threading\ShellLocks.cs:line 921
 at JetBrains.VsIntegration.ProjectModel.VsHierarchyToProjectInfoMap.GetAllProjectInfos() in c:\BuildAgent\work\33fb4a13d5bb6cc2\Platform\src\VisualStudio\Core\src\ProjectModel\VsHierarchyToProjectInfoMap.cs:line 242
 at JetBrains.VsIntegration.ProjectModel.VsHierarchyToProjectInfoMap.TryGetProjectInfoByProject(IProject project) in c:\BuildAgent\work\33fb4a13d5bb6cc2\Platform\src\VisualStudio\Core\src\ProjectModel\VsHierarchyToProjectInfoMap.cs:line 227
 at JetBrains.VsIntegration.ProjectModel.ProjectModelSynchronizer.GetProjectInfoByProject(IProject project) in c:\BuildAgent\work\33fb4a13d5bb6cc2\Platform\src\VisualStudio\Core\src\ProjectModel\Builder\ProjectModelSynchronizer.cs:line 417
 at AgUnit.Runner.Resharper80.UnitTestFramework.SilverlightPlatform.ProjectExtensions.GetXapPath(IProject silverlightProject)
 at AgUnit.Runner.Resharper80.UnitTestFramework.SilverlightPlatform.UnitTestSequenceExtensions.AddSilverlightUnitTestTask(IList`1 sequence, IProject silverlightProject, UnitTestProviders providers, IUnitTestRunStrategy runStrategy)
 at AgUnit.Runner.Resharper80.UnitTestFramework.SilverlightPlatform.SilverlightPlatformSupportExtensions.ConvertToSilverlightSequenceIfNecessary(IList`1 sequence, UnitTestRun run, IUnitTestLaunch launch, UnitTestProviders providers, ITaskRunnerHostController hostController)
 at AgUnit.Runner.Resharper80.UnitTestFramework.SilverlightPlatform.SilverlightPlatformSupportExtensions.EnsureSilverlightPlatformSupport(IUnitTestLaunch launch, UnitTestProviders providers, ITaskRunnerHostController hostController)
 at AgUnit.Runner.Resharper80.UnitTestFramework.HostProviderWrapper`1.CreateHostController(ISolution solution, IUnitTestLaunchManager launchManager, IUnitTestAgentManager agentManager, IUnitTestLaunch launch)
 at JetBrains.ReSharper.UnitTestExplorer.Launch.UnitTestLaunch.Run(UnitTestElements elements, IEnumerable`1 projects, IHostProvider hostProvider, PlatformType platformType, PlatformVersion platformVersion) in c:\BuildAgent\work\33fb4a13d5bb6cc2\Psi.Features\src\UnitTesting\Explorer\src\Launch\UnitTestLaunch.cs:line 131
 at JetBrains.ReSharper.UnitTestExplorer.Launch.UnitTestLaunchManager.RunSession(IUnitTestSession session, UnitTestElements elements, IHostProvider hostProvider, JetHashSet`1 projects, IUnitTestLaunch launch, PlatformType platformType, PlatformVersion frameworkVersion) in c:\BuildAgent\work\33fb4a13d5bb6cc2\Psi.Features\src\UnitTesting\Explorer\src\Launch\UnitTestLaunchManager.cs:line 178
 at JetBrains.ReSharper.UnitTestExplorer.Launch.UnitTestLaunchManager.<>c__DisplayClass11.<BuildAndRunSession>b__c() in c:\BuildAgent\work\33fb4a13d5bb6cc2\Psi.Features\src\UnitTesting\Explorer\src\Launch\UnitTestLaunchManager.cs:line 136
 at JetBrains.Threading.ThreadManager.PooledThread.ThreadProc() in c:\BuildAgent\work\33fb4a13d5bb6cc2\Platform\src\Util\src\Threading\ThreadManager.cs:line 165
 at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
 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.Threading.ThreadHelper.ThreadStart()


which are the only ones with the string "agunit" in it. this ssems to be a bug in ReSharper 8.0:

link


I found by trial and error that another project is connected to this. When I remove the Workflow Provider project from the solution, the problem disappears. this is a workflow foundation project that is not really connected to the project containing the test. I will explore possible connections, though.

I can email you the logfile, if you wish.