I have an MVC project thats been working perfectly until I updated my machine a week ago. I now receive a Binding Error when trying to run the project
Managed Debugging Assistant 'BindingFailure' has detected a problem in 'C:\Program Files (x86)\IIS Express\iisexpress.exe'.
Additional information: The assembly with display name 'Microsoft.VisualStudio.Web.PageInspector.Runtime' failed to load in the 'LoadFrom' binding context of the AppDomain with ID 2. The cause of the failure was: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.Web.PageInspector.Runtime, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
If I continue past the error the project loads correctly. However when I run the project as a web role in a cloud service, it will not run as it keeps popping up with the role is taking longer than expected.... message
I'm assuming this has to do with the binding problem when running as a stand alone project
Has anyone come across this before?
EDIT I searched for the assembly reference in the config files, nothing came up. Eventually I just reinstalled the new azure SDK. The binding error message with the pageinspector still pops up on load but if I continue the project, it works fine. At the moment I will have to live with this annoying message until I find a solution
If you uncheck Thrown Exceptions in the exception options it should stop prompting you. I'm guessing it is part of its normal operation. I've noticed the same thing.
We encountered a similar problem by deploying assemblies generated by ASP.NET from a developer machine to a production environment (referring to assemblies generated for .ascx and .aspx controls which are compiled at runtime).
We are (hackishly) copying and persisting such runtime generated assemblies from ASP.NET temporary compile folders (ie. "C:/Users/[USER]/AppData/Local/Temp/Temporary ASP.NET Files/") to avoid some recompiling as the service boots, in order to improve performance. However using assemblies compiled on a dev machine introduces dependencies to VisualStudio assemblies.
We fixed it by letting the production environment generate these assemblies on its own. We are copying and persisting these 'production' assemblies instead and the problem vanishes entirely.
Make sure you are not doing such awkward use of ASP.NET generated assemblies and it will probably fix it.
Instead of changing the framework files, try adding this to the web.config file:
i've observed this happening on a machine with Visual Studio 2013 installed.
it began happening, as best I can tell, after the VS2013 update 4.
(it may have occurred previously, but this is new for my environment)
I located this assembly in the GAC (two versions, one for VS2012, the other for VS2013) but these versions are strong named (obviously) with a version of "12.3.0.0" (take note the above resolution error is for a version "14" assembly.)
Here is the call stack for the first instance of this particular exception:
This suggests the problem is Microsoft's (and not something I've done in, say, an assembly, application nor machine config.)
I spot-checked all of my configs (literally, all, my project's web.config as well as all .NET runtime machine configs, all versions/platforms) and I could not find a reference to this assembly anywhere.
To work around this mistake (which Microsoft needs to address) I've added an assembly binding redirect, as follows, to my web.config (NOT my machine configs):
This suggests Microsoft released a build of Visual Studio, or similar, which is binding against a future, unreleased version of these assemblies.
Hope this helps someone else out there!