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

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.

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.

Related

databaseinitializer is not called, configured via web.config

I'm trying to launch the databaseinitializer but nothing happens. It used to work before I switched from MySql.Data.Entity.EF6 to the new one. I can write anything as the attribute type of context and it will still load the app but the database is never initialized.
Thanks
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
...
<entityFramework>
<contexts>
<context type="GroupeFleury.DAL.ApplicationDbContext, GroupeFleuryApps, Version=1.0.0.0, Culture=neutral">
<databaseInitializer type="GroupeFleury.DAL.DbInitialisateur, GroupeFleuryApps, Version=1.0.0.0, Culture=neutral" />
</context>
</contexts>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"></defaultConnectionFactory>
<providers>
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.EntityFramework"/>
</providers>

error There is a duplicate 'entityFramework' section defined

I get this error :
Config Error There is a duplicate 'entityFramework' section defined
Config File \\?\D:\koopaproject\koopaproject\web.config
9: <!--For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468-->
10: <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />11: </configSections>
In my web.config:
<configSections>
<!--For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468-->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</configSections>
<connectionStrings>
<add name="koopaco.com_koopaContext" connectionString="Data Source=localhost;Initial Catalog=koopaco.com_koopa;Persist Security Info=True;User ID=koopaco.com_zohre;Password=136613;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
</connectionStrings>
And I installed :
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
But I still get this error.
I just had the same problem. The cause of my issue is that whilst I was running the application via IIS (as an application under the Default Web Site), there was a Web.config in the root that also had the <entityFramework> section defined.
Removed the Web.config from the root, and problem was solved.
Add this to web.config file
<entityFramework xdt:Transform="RemoveAll" />
If you have this problem while testing in IIS Express, look for a conflict in the higher-level "web.config" used by IIS Express. I found that I had a problem in C:\Users\yourUserIDHere\Documents\IISExpress\config**applicationhost.config**.
applicationhost.config is a sort of higher-level web.config for IIS Express.
My site was defined in there with a left over folder location on my C: drive where I had run an older copy of my project in the past.
Add this to web.release.config file
<entityFramework xdt:Transform="RemoveAll" />
so that when you deploy the web application entityFramework will not be on the web app's config file

IIS 6 asp.net 4 mvc 2 attempt

I am trying to install my application onto IIS 6. It's asp.net 4 mvc 2. I get this error:
Could not load file or assembly 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
In my Web.config I have this:
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
</compilation>
Does anyone have any ideas for a solution? I would think it is some setup of IIS6 with asp.net.
Thanks
--MB
Make sure you have installed ASP.NET MVC 2 on your server.
check haack's post
http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx
If MVC isn't available and installing it on the server isn't an option, try bin deploying dependencies:
http://haacked.com/archive/2008/11/03/bin-deploy-aspnetmvc.aspx

Unknown server tag 'asp:EntityDataSource'

I uploaded my files to my remote server having support for ASP.Net 3.5. Website is developed using ASP.Net 3.5 and Entity Framework. Also i copied the dlls to bin folder. But i am getting the following error
arser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Unknown server tag 'asp:EntityDataSource'.
In the compilation section of your web.config, you need to add:
<compilation debug="true" defaultLanguage="C#">
<assemblies>
<add assembly="System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<add assembly="System.Web.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
In the controls section, you need to add:
<controls>
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</controls>

Microsoft Reporting v.10 load problem

I am trying to reference microsoft reporting v.10.0.0.0 in my vs studio web site. For some reason it can't achieve that as it is always giving me a compile error that it could not load the type.
Error 2625 Could not load type 'Microsoft.Reporting.RdlBuildProvider' from assembly 'Microsoft.ReportViewer.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
One thing that I think it might be a cause is that I had moved from 9.0.0.0 to 10.0.0.0 and after that it does not work.
Any suggestions?
Thanks a lot!
After replacing all ofthe references from version 8 or 9 to 10 (in webconfig and also in your asp.net pages. In web.Config file you have to change the following line from
<compilation debug="true">
<buildProviders>
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</buildProviders>
</compilation>
to
<compilation debug="true">
<buildProviders>
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</buildProviders>
</compilation>
Update
You also have to update all of the other reference Number from 9.0.0 to 10.0.0
RdlBuildProvider has been moved to Webforms in version 10, which used to be in common earlier
Adding this to provide a complete answer.
Notice that the key token is the same for v8 and v10. Also, as Madhu said, note that Microsoft.Reporting.RdlBuildProvider has been moved from Common to Webforms as shown in the buildProviders section.
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="Microsoft.ReportViewer.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="Microsoft.ReportViewer.ProcessingObjectModel, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
</assemblies>
<buildProviders>
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Webforms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</buildProviders>
This solved my issue:
http://social.msdn.microsoft.com/Forums/en-US/vsreportcontrols/thread/8287e1cd-767e-463c-8cb0-60c275fe5ed6