In Visual Studio 2013 in a fresh C# MVC 4 empty project I right click the controllers folder and select Add -> Controller... then select a name for the controller and click Add. I get the following error popup:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ItemTemplates\CSharp\Web\MVC 4\CodeTemplates\AddController\Controller.tt(-1,-1): error: There was a problem getting an AppDomain to run the transformation from the host. The process cannot continue.
This also occurs when adding a view to the views folder using corresponding context menu option.
Question: what is the next step to troubleshoot this?
What I've tried so far:
- Restart visual studio
- Uninstalled ASP.NET MVC 4 and Nuget Package Manager. Re-installed Nuget Package Manager. Tried with and without re-installing MVC 4. (see also: Microsoft Connect)
- Verified that I do not have the following line in my
devenv.exe.config
:<NetFx40_LegacySecurityPolicy enabled="true" />
() - Run Visual Studio in safe mode (
devenv.exe /safemode
) to rule out extensions - Reboot machine
- Repair visual studio
Additional context:
- Before I got this error I was able to successfully add multiple controllers and views without a problem. No visual studio restart or anything unusual happened between the successful and failed attempts.
- I can go through the Add New Item dialogue and successfully add a controller or view, but the context menu Add -> Controller and Add -> View give the above error.
- I have Visual Studio 2013 Update 4
- Extensions I have added:
- .net reflector,
- attach to anything,
- rename visual studio window title,
- slowcheetah – xml transforms,
- team foundation server power tools 2013,
- visual studio 2013 color theme editor,
- web essentials 2013 for update 4,
- wix toolset
Best Answer
Additional things to check, as I've seen this happen before on Vista and newer operating systems: