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

浪尽此生 提交于 2019-12-01 02:25:25

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.

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.

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... ;)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!