Daily Usage Issues

Starting VS2015 in Safe Mode shows strange error in NCrunch window

Started by abelb on 6,949 views

When I start Visual Studio 2015 in safe mode (as with devenv.exe /SafeMode), the NCrunch Configuration window (which I have usually open), looks as follows:

External image

It is actually a text box and the error is:

An exception was encountered while constructing the content of this frame. This information is also logged in "R:\AppData\Microsoft\VisualStudio\14.0\ActivityLog.xml".

Exception details:
System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
at Microsoft.VisualStudio.Shell.Interop.IVsShell5.LoadPackageWithContext(Guid& packageGuid, Int32 reason, Guid& context)
at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.GetPackage()
at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.ConstructContent()


Now, I don't expect NCRunch to work in any way (in fact, I think it should be unloade?) when running Safe Mode, but certainly, the error itself is unnecessary and/or ought to be suppressed?

(I am not trying to solve the error, when running in safe mode, I actually expect extensions not to be loaded, but I notice that quite a few extensions, including NCrunch, PostSharp, .NET Reflector, ResX, get loaded anyway, albeit with odd behaviors, but that is besides the point here)

Edited

Hi, thanks for sharing this issue.

Under safe mode, VS likely isn't fully initialising the NCrunch package. However, it looks like VS is still loading the solution.user file which contains the various tool window layouts.

So what we have here is a tool window that has been left open belonging to an extension that is disabled. Because the code behind the tool window isn't allowed to execute, you see an error.

I don't see a way for NCrunch to cleanly handle such a situation. Because the VS instance is in safe mode, NCrunch isn't actually allowed to execute any code. The exception you're seeing here is probably benign and closing the tool window will likely solve the problem entirely.
Yes, you are probably right. I had the impression that VS was executing *some* code of the extension, but if it is executing no code at all, there'll little to nothing you can do. Besides, I think that by maintaining the window layout, as VS is doing, at least I won't use any window layout related issues.

Strange, when I run VS in Safe Mode again, this time the menu items (NCrunch, .NET Reflector, PostSharp, even Architecture) have disappeared, while they were showing the first time around.

Also, in my Window Layout are windows of .NET Reflector Analyzer and .NET Reflector Object Browser, and they simply show up empty (dark background, no error). Which appears to me that at least for some extensions they managed to "die silently" when requested to open in Safe Mode. I checked online for some references in the VS documentation on writing extensions but couldn't readily find it.

Of course, like you mention, the error itself is clearly harmless.

Post a reply

Log in to reply.