Error when creating a Partial View in Visual Studio 2012 Express with Razor
Asked Answered
I

4

17

I am creating a view in Microsoft Visual Studio 2012 Express and I want it to be a strongly-typed partial view, but I am getting the following error:

C:\Program Files(x86)\Microsoft Visual Studio 11.0\Common7\IDE\VWDExpress\Item Templates\CSharp\Web\MVC 4\CodeTemplates\AddView\CSHTML\Empty.tt(-1,1) : error : There was a problem getting an AppDomain to run the transformation from the host. The process cannot continue.

I have not had any trouble creating views that are not partial views, strongly-typed or not.

Inaccessible answered 1/2, 2013 at 18:48 Comment(3)
"Have you tried turning it off then on again?"Enrico
@BennorMcCarthy "Have you tried turning it off then on again?" <-- the first principle of computer science ;)Presidium
restarting didn't work for me, see my answer at: #14638132Vereen
P
47

Is simple... Just restart Visual Studio.

http://blog.jongallant.com/2012/07/appdomain-process-cannot-continue.html#.UQwtQs6mg1I

Presidium answered 1/2, 2013 at 19:26 Comment(2)
For anyone with VS2012 Update 3 , this is happening to me when I sometimes click on a method in a controller and click on "Add View" , but indeed the restart of visual studio does fix this. thxRant
Worked in VS 2019 for me as wellScaramouch
G
4

I was using Visual Studio 2013 Professional and had the same issue and none of the following worked for me-

  • Restarted VS- didn't helped
  • There was no <NetFx40_LegacySecurityPolicy enabled="true" /> in devenv.exe.config file
  • Reinstalled Nuget Package Manager from VS > Tools > Extensions and Updates
  • Reinstalled MVC4 from Microsoft

Then I repaired my VS installation from Control Panel > Add/Remove Programs and my issue was resolved. I don't know what went wrong but this certainly needs attention by Microsoft Guys. Hope my answer helps out somebody in need.

Gyrostabilizer answered 5/2, 2015 at 7:21 Comment(2)
Your problem is outside of the 99% of the problems that solves the first principle of computer science: restarting. Sad.Presidium
@pabloker You're absolutely right, this truly took so much important time repairing visual studio installationGyrostabilizer
A
2

I was using VS12 and Updated to VS13, i was unable to create views and was getting the above error, I just updated Nuget Package Manager by going in Tool --> Extension and Updates and everything worked fine for me.

Awry answered 17/4, 2015 at 7:33 Comment(0)
D
0

As I was having same issue, I realized that this workaround may work for some of us, but... In my case, it did not work. But changing the devenv.exe.config, removing the line

<NetFx40_LegacySecurityPolicy enabled="true" />

did the trick. Hope it helps those like me, need to have that anoying thing for some older solutions... ;)

Disfranchise answered 3/10, 2013 at 17:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.