Why does Visual Studio crash opening ASPX with MVC RC1 - asp.net-mvc

Upgraded from MVC Beta to MVC RC1.
Re-pointed all references in the project to point to the new assemblies
Rebooted
Everything compiles (and runs!)
But...
Opening a view (.aspx) in VS and she just disappears!
Event Viewer gives:
NET Runtime version 2.0.50727.3053 - Fatal Execution Engine Error (6E075E00) (80131506)
Update 1:
Not ALL .aspx pages!
Also - it seems that writing the question on StackOverflow is the fix! grr
Update 2:
Not had the problem since posting the question but:
The only plugins I have are VisualSVN and Resharper.
I do seem to have something in the GAC for System.Web.Mvc - but it looks like the wrong version and I can't get rid of it.
I believe it must be related to some intelli-sense colouring or similar during the render of the code of the .aspx page - but now it's stopped it is hard to confirm...

Try removing all bin/obj directories, and clearing your Temporary ASP.NET Files and %TEMP% directories. Then issue the following commands from a VS2008 command prompt:
ngen /delete System.Web.Mvc
ngen /delete System.Web.Abstractions
ngen update
Also ensure that all your references (MvcContrib, anything else built against MVC) are pointing to the same version of MVC as all the others.
This seems to have worked for me (so far)

There are some framework bugs that affect all VS add-ins etc if they reference System.Core v3.5. Start by clearing out the NGen cache. "ngen update", "ngen /delete [assemblyname]" or a sweeping "ngen /delete *" usually does the trick
More details + workarounds for this (and/or similar) issues here:
http://forum.huagati.com/topic5-addin-causes-ide-to-close.aspx
http://code.msdn.microsoft.com/PowerCommands/WorkItem/View.aspx?WorkItemId=8
http://www.jetbrains.net/devnet/thread/274657
Update: finally someone from MSFT acknowledge that there is a problem:
http://blogs.msdn.com/jnak/archive/2009/02/15/potential-crash-in-vs-when-using-the-mvc-rc-on-windows-azure.aspx
Update 2: An attempt at a workaround (VS2008 add-in): http://www.huagati.com/ProjectLoader/
Update 3: Microsoft has a CLR patch (KB963676) that fixes this problem. It is not available for download from microsoft.com but it can be requested through MSFT support / PSS.
Update 4: The CLR patch is now available for download from Microsoft Connect:
https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=16827&wa=wsignin1.0
http://blogs.msdn.com/jnak/archive/2009/02/26/fix-available-asp-net-mvc-rc-crash-in-a-windows-azure-cloud-service-project.aspx

I had to remove the PowerCommands add-in to get VS working again.

I've had problems like that before. It was the webform editor. If you right-click the aspx file and choose "open with..." and select Html-editor the ide will most likely not crash on you.
Try disabling addIns one by one.
For me it was a conflict between gallio and testdriven.net I think.

Microsoft have now released a hotfix to resolve this issue.
See https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=16827&wa=wsignin1.0
Phil Haack elaborates further here - http://haacked.com/archive/2009/03/06/hotfix-for-installing-aspnetmvc.aspx

I'm having the same problem and have posted a reply on the official ASP.NET MVC forum at http://forums.asp.net/t/1378448.aspx
I'm not sure, but are you also seeing reference to the Html helpers not showing up in the views (when they don't crash)?
I don't have Gallio installed, but I do have Resharper. I'll see if disabling that helps (although that would cause me a lot of anguish).
Update: Resharper wasn't the issue, but rather the plugin "Huagati DBML/EDMX Tools." It seems some plugins might be conflicting and I encourage people to disable all plugins as a preliminary step in debugging the crashes.

I have found that any compile issues with the master page or the page itself -- even warnings -- can cause this to happen. So close the project, delete the bin and obj directories, then re-open the project. Next open your master page(s) and any other recently changed aspx/ascx files. It is important to open all before you compile.
Now, viewing each page one at a time, compile the project and resolve the warnings. Once all the warnings are resolved, close the pages and try to re-open them.

I got the exact same error. At first I thought it was the Spark View Engine add-in (because it crashed opening views) but after Christian's comment about Gallio and TestDriven.NET (I have both) I uninstalled Gallio and now it works.

The problem was indeed, powercommands for VS 2008. Uninstall them if you can live without them and the aspx pages/designers will open fine.

Actually I think my problem was some rogue copies of the Beta MVC DLLs hanging around.
I deleted them all, uninstalled the RC1 and made sure they all left the GAC and then reinstalled the RC1. So far everything seems fine.

This occurred for me after setting the reference to System.Web.Mvc to Copy Local = True. This placed the System.Web.Mvc.dll file in my bin folder.
The next time I opened any aspx pages Visual Studio crashed. Changing the dll in the bin to System.Web.Mvc.dll.bak fixed the problem.

I finally (after a fews days of trying everything) got it resolved by uninstalling the Spark View Engine add-in, which crashed when opening .aspx and .js files!

Related

Umbraco 7.6.1 Won't Upgrade

I have an Umbraco 7.6.1 site which I'm trying to upgrade to a later version, I'm not sure which version I'm going to yet, but the problem exists no matter the version jump.
The Umbraco project is set up in Visual Code IDE and uses NuGet.
So I go to the projects NuGet package manager and update UmbracoCMS from 7.6.1 to 7.6.2. I don't overwrite files. I've tried overwriting files and checking what it's doing in git, but with no luck either.
All seems well. I then build the project and load up the site in debugging mode. I get asked to log in and pushed to the upgrade page. I then hit continue and shown "Error during installation" instantly. It also tells me to check the logs, which are non-existent.
What am I doing wrong?
Thanks,
Dan
To fix the issue I was having I commented out any rewrite rules I was including in my main Web.config and cleared out everything in the bin folder and re-built the solution. That seemed to have done the trick.

Upgrading to Visual Studio 2015 renders intellisense broken for project

I've been through a lot of similar issues, but could not find anything that worked for me.
I'm upgrading my IDE from the VisualStudio for Web (v10) to Visual Studio 2015 (v14, I guess) Community Edition.
The main project that I'm trying to use on the new IDE is a MVC 5 (5.2.3), with EF 6.1 (6.1.3) and a bunch of other stuff.
Problem is: When opening the project on the new IDE, everything looks fine (it even compiles and work). I got the MVC context menu working on the project explorer (showing the "Add Controller..." and "Add View..." when appropriate). Only (really annoying) thing is the Razor Intellisense.
When I do open a View file (.cshtml) I receive warnings on several helpers, some of the "using" are greyed out (even though they're supposed to be needed) and the #model myModel is shown like everything after the #model directive is not razor (it's treated like HTML by the intellisense coloring).
What I've already found and tried:
I've already tried to clear the UserData from the vs (devenv /ResetUserData)
I've already tried to run the VS2015 in safe mode
I've already tried to run VS2015 as Administrator
I've already tried to set the Project's target framework to 4.5.1 (used to be 4.5)
I've already tried to open the project on Visual Studio Community 2013 saving it there before trying to use it on VS2015.
When creating another MVC project from the VS2015, everything works fine.
Here's an example of the annoying issue:
Ok, finally got it.
Posting what I found out believing it may help someone else:
What seems to cause the problem mentioned is the fact that the project was created on an old MVC version (with older Razor, EF, etc).
As stated in this answer: Visual Studio 2015 Razor View MVC Types not recognized, VS2015 tools may not work for older MVCs.
The solution is to update all your packages to [at least] the minor versions accepted on newer MVC (5?). To do so you can use the list in this website: http://www.asp.net/mvc/overview/releases/how-to-upgrade-an-aspnet-mvc-4-and-web-api-project-to-aspnet-mvc-5-and-web-api-2.
Once everything is up-to-date, open the web.config files located on root of your application and on the Views folder. In there, you will probably find some references to the older versions of MVC and Razor. Update those versions values (all of them) to match the updated versions of your packages (you may create a new empty MVC project on the new Visual Studio and check for those values as a hint of what they should be).
This step is the catch! Since, even if you update you project's packages, some web.config references may still mention the original versions.
Clean the solution (Build > Clean Solution) and close the project. Reopen and compile it. Now [hopefully] everything should be working fine.
[Edit]
One more thing: If your project was also updated from Framework 4.5 to 4.5.1 during this IDE transition, you should also install a NuGet package called "Microsoft.CodeDom.Providers.DotNetCompilerPlatform" (as stated in https://support.microsoft.com/en-us/kb/3025133).

Strange issue with System.Web.Mvc losing its reference when checking out of TFS

I'm working with another developer on a project and everything has been working great until today. Now when I check out the solution to my Visual studio 2013, my reference to System.Web.Mvc is lost and I have to manually re-add it.
When I check in and she checks out, the same issue occurs for her. The path to the assembly is the same on both of our machines:
C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC
4\Assemblies\System.Web.Mvc.dll
but for whatever reason, we're not in sync. As I said above, it was working great until today so something must've changed...but I have no idea what???
Any suggestions/ideas of what to look for to resolve this?
TIA
This issue occurred due to a Security update that incremented the version of MVC. So if you had References in your project pointing to the hard drive where the 2.0/ 3.0/ 4.0 version was. Your project was needing that particular version. Another way to solve this is to use Nuget to update references.
This is a post from Microsoft regarding the issue:
http://blogs.msdn.com/b/webdev/archive/2014/10/16/microsoft-asp-net-mvc-security-update-broke-my-build.aspx

MVC 2 to MVC 3: MvcScaffolding fails due to "could not load file or assembly" error

Setup:
I am using MVC 3, EF 4.1, Visual Studio 2010 SP1 with Power Tools updated to latest version.
With the above installations, I don't need the NuGet packages that were required previously. Everything is RTM.
The project has been upgraded from MVC 2 to MVC 3. I initially tried the upgrade tool, but that gave me grief, so I did it manually as per the instructions in the MVC 3 Read Me file.
Problem:
When trying to use the new scaffolding of controllers and views for CRUD functionality (against Code First DbContext), the scaffolding fails with the error:
Could not load file or assembly 'file:///C:\[PATH TO MY APP]\bin\Lanap.BotDetect.dll'
or one of its dependencies. Operation is not supported.
(Exception from HRESULT: 0x80131515)
Question:
Lanap.BotDetect is a Captcha control. It works fine and is there, I use it in other pages no problems, the solution compiles, etc, etc. So there is no problem with this dll.
However, this error is stopping me using the new scaffolding capabilities.
I can't see what it has to do with the scaffolding of a new controller and its views, so there must be some configuration that is wrong.
Any suggestions as to where I can look? Googling has drawn a blank.
EDIT 1:
I am trying to see the failed assembly binding using Fusion Log as suggested in a comment. No failed binding showing (but that might be my fault) but the question remains:
Why would MvcScaffolding NEED to load the Captcha .dll at all? It is just scaffolding a controller, and nothing in the T4 says anything about this .dll
(NOTE: I haven't edited the scaffolding T4 code)
EDIT 2:
I tried removing the reference to Lanap.BotDetect, and the error changed to not being able to open the config file that has the connection strings (I shunt the connection strings out to a db.config string, just gives me less visual pain when looking at a config file).
I am giving up on scaffolding on this app. It works in clean, new apps, but not this one where there is a lot of pre existing code.
I found another solution to this. Turns the issue for me was that the issue was it was being built over a network drive. So when I moved the project over to a location local to my machine and rebuilt the project it corrected everything. I detailed everything with screen shots and here...
http://ryandunn.co/mvc-growing-pains-could-not-load-file-controller-dll
Put simply check the location of your project and move it to C: after that a quick rebuild had me back and working normally.
So I know that you have moved on but I ran into the same problem and just found the solution. It turns out the error is due to the assembly not being trusted i.e. you downloaded it from the internet.
You can right click the .dll and unblock it to fix the problem. For info on how to unblock see the following
http://blogs.msdn.com/b/brada/archive/2009/12/11/visual-studio-project-sample-loading-error-assembly-could-not-be-loaded-and-will-be-ignored-could-not-load-file-or-assembly-or-one-of-its-dependencies-operation-is-not-supported-exception-from-hresult-0x80131515.aspx

ASP.NET MVC CTP5 Crashing IDE

I've recently installed the MVC CTP5 and VS is now crashing on me when I try to open an aspx, I get the following error in event viewer:
.NET Runtime version 2.0.50727.3053 - Fatal Execution Engine Error (7A035E00) (80131506)
I was able to find This post on the asp.net forums relating to the same issue but nobody has had a working solution yet (at least not for me).
Just wondering if anyone else has run into this issue and what they have done to resolve it?
EDIT: Wanted to add that I have tried all the tips in the article and can open the markup with a code editor but was wondering an actual solution had been found to resolve this issue.. Thanks!
EDIT: I don't have this issue on my Vista box, seems to only occur on my XP VM.
I had a problem with Power Commands and Preview 5. If you have Power Commands installed, try updating or uninstalling it to fix the issue.
Here are a steps to work around from the post that work for me:
1.Open project based on CTP5
2.IN solution Explorer, enable "Show All files"
3.Open "bin" folder and delete "Microsoft.Web.Mvc.dll", "System.Web.Mvc.dll", "System.Web.Abstractions.dll", "System.Web.Routing.dll"
4.Open "References" folder, click ONCE "System.Web.Abstractions" and in Properties window change "Copy Local" to true. Repeat same with System.Web.Routing.
5.Build application (Ctrl+Shift+B)
6.Open site.master in designer. VS will not crash.
FYI - Microsoft has released a hotfix that fixes [at least some variations of] this problem:
https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=16827&wa=wsignin1.0
http://blogs.msdn.com/jnak/archive/2009/02/26/fix-available-asp-net-mvc-rc-crash-in-a-windows-azure-cloud-service-project.aspx
A bit of a null answer but I’ve been having this too. Not that I restart VS often but cleaning out the bin folder before opening the web project is my workaround.
Have same problem, on vista x64 and vs2008 sp1. Have to do probably something with cleaning bin folder and system.web.routing/abstraction, because it crashes even on webforms project with (mvc) routing in it. When I delete all files from bin, and add references again, it works fine.
Really annoying bug in vs2008+ctp5!

Resources