In web.config, A duplicate 'system.web.webPages.razor / host' section is defined

1

I'm trying to run this app https://github.com/martinokello/EntertainmentTicketMaster

But when I run this app, some errors happen.


Module IIS Web Core

Notification BeginRequest

Handler Not yet determined

Error Code 0x800700b7

Configuration error A duplicate 'system.web.webPages.razor / host' section is defined.

Requested URL http://localhost:6848/Views/Account/Login.cshtml

Physical Path F:\code\EntertainmentTicketMaster-

master\EntertainmentTicketMaster\Views\Account\Login.cshtml

Logon Method Not yet determined

Logon User Not yet determined

Request tracking directory C:\Users\young\Documents\IISExpress\TraceLogFiles\ENTERTAINMENTTICKETMASTER

Configuration Source

 5:     <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
    6:       <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
    7:       <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />

I searched several articles to solve this error, but they didn't work.

Above configuration error says A duplicate 'system.web.webPages.razor / host' section is defined.

And I inspected that.

And this codes which are related to this error are defined in both web.config of root directory and view folder.

 5:     <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
    6:       <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
    7:       <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />

What causes this error and how can I solve this? Please help me.

web-config
asked on Stack Overflow Aug 1, 2017 by young

1 Answer

0

And this codes which are related to this error are defined in both web.config of root directory and view folder.

This is why you receive this error. You should define it only in root directory.

answered on Stack Overflow Aug 1, 2017 by Elvis Plesky

User contributions licensed under CC BY-SA 3.0