Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parameter name Type ISession cannot be resolved when debugging in Visual Studio 2015

Started getting a new error when starting a debugging session in VS2015. It's an ASP.NET MCV project that also exposes a WCF service (don't know if that's relevant).

The debugging session takes ages to start up and then I get a message box saying:

Specified argument was out of the range of valid values.

Parameter name: Type ISession cannot be resolved. Interfaces of abstract classes should be registered first.

After that the debugger works as expected.

If I do the same thing from VS 2013 then it takes a long time to load but I get a message saying:

Loading symbols for WebActivatorEx.dll from: d:\Code\GitHub\WebActivator\WebActivator\obj\Debug

This is strange because I haven't knowingly installed WebActivator and my D: drive is a DVD that I haven't opened since I got the PC.

Yesterday I installed OpenCover, but it didn't work so I removed it.

Anyone out there who might have an idea of what's going on???

Thanks

like image 265
David Hyde Avatar asked Sep 22 '15 13:09

David Hyde


1 Answers

I had the same problem in my local workstation while my colleague was able to debug and run his web application fine. The said error message was thrown from visual studio 2015, but application used to launch fine and run. This was happening only in debug mode (either with "Start debugging" - F5 or debug mode of the project). The other side effect was that this problem was not occurring for the very first time after every system restart. This thread along with the link How do you clear your Visual Studio cache on Windows Vista? and the link https://blogs.msdn.microsoft.com/willy-peter_schaub/2010/09/15/if-you-have-problems-with-tfs-or-visual-studio-flush-the-user-cache-or-not/ pointed me in right direction. I was finally able to resolve the issue by clearing the contents from the following three directories on my local workstation:

a) <System drive>:\Users\<user id>\AppData\Local\Microsoft\Team Foundation
b) <System drive>:\Users\<user id>\AppData\Local\Microsoft\VisualStudio
c) <System drive>:\Users\<user id>\AppData\Local\Microsoft\VSCommon

The resolution makes me think on the lines of the accepted response provided with the first link above. There Visual Studio and Team Explorer cache might have gone out of sync. Hope this answer helps people facing similar issues.

like image 56
Sudhir Avatar answered Sep 19 '22 06:09

Sudhir