How t solve "HTTP Error 500.19 - Internal Server Error" in VS'13

0

I am running a application in Visual Studio 2013 and for Entity framework used Microsoft SQL Server Management Studio 2012. Everything alright from beginning but when I used those command for using HtmlHelpers inside my project that time got those error [Error Code 0x80070032 ]:-  Error Code  0x80070032

My Web Config Code:-

<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory,System.Web.Mvc, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
  <namespaces>
    <add namespace="System.Web.Mvc" />
    <add namespace="System.Web.Mvc.Ajax" />
    <add namespace="System.Web.Mvc.Html" />
    <add namespace="System.Web.Routing" />
    <add namespace="SportsStore.WebUI" />
    <add namespace="SportsStore.WebUI.HtmlHelpers"/>
  </namespaces>
</pages>
 </system.web.webPages.razor>
visual-studio-2013
sql-server-2012
entity-framework-5
asp.net-mvc-5
asked on Stack Overflow May 16, 2014 by mgsdew

2 Answers

1

Be sure you are editing the web.config within the Views folder in MVC, not the project root web.config. The web.config in Views folder will have all the necessary sections for Razor etc. and that is the file Razor Configuration would use to resolve namespaces.

If you are making changes to the Views folder web.config, make sure you are not missing the configSections declaration (ex below for MVC4)

<configSections>
    <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
      <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
    </sectionGroup>
  </configSections>
answered on Stack Overflow May 16, 2014 by Pepto • edited May 16, 2014 by Pepto
1

I also try this project which is given on Pro MVC 4.0 and solution is :-

Add this line on top of your 'List' View and don't need to any change/add any line in Web-Config file.

@using SportsStore.WebUI.HtmlHelpers

Hope this works for you :)

answered on Stack Overflow May 17, 2014 by user3621816

User contributions licensed under CC BY-SA 3.0