Everything compiled fine and the app is running well. However when I attached the debugger to w3wp.exe and however over variables, no value was being shown. Ctrl-Alt-Q on one for Quick Watch revealed the problem.
error CS1704: An assembly with the same simple name ‘###’ has already been imported. Try removing one of the references (e.g. ###.dll) or sign them to enable side-by-side.
Error seems straight forward enough. Help points to fixing references as the error would suggest. This only just started happening. And not just me. So it must be a code change right? Looking through version history, everything looks innocent. I check the references and they are all fine. So I must have some messed up assemblies somewhere.
Clean entire workspace. tfpt treeclean
Restart visual studio.
Rise & Repeat…
No avail. Both my git and TFVC workspaces have the same problem.
Reboot computer in case of cache.
Then I delete the Temporary ASP.NET Files for the web site in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files.
Bingo! Some change must have caused a duplicate to be place in there somehow. Not the best resolution, but as least I can inspect the code with the debugger again.
Thanks, my problem was similar.
Got rid of my sites from
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files
And deleted all of the problem dlls from source code folder (some had different dates). Then rebuild and only the up to date dlls would be everywhere.
Then debugging was perfect.
I found another workaround – enable debug managed compatibility mode, but I don’t like that since it uses a different debugger that has many limitations. But if someone has to urgently debug something and the above doesn’t work, they could try it.
Pingback: Visual Studio 2015 fails to evaluate variables when two versions of assembly are loaded « news-Knowlage FeeD