ASP.NET project throws HTTP Error 500.19 when moved to another computer

2

I copied a 3 layer ASP.NET project from a system running Visual Studio 2010 to my system which is also running Visual Studio 2010. When I right click and select view in browser on a file inside a folder located under the UI layer, I get the error:

HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.

Attached is a screen shot of the error pageenter image description here

Below is the Web.config file inside the folder under UI layer

<?xml version="1.0"?>
<configuration>
    <system.web>
      <authorization>
        <allow roles="user,admin"/>
        <deny users="*"/>
        <deny users="?"/>
      </authorization>
    </system.web>
  <location path="fixdashboard.aspx">
    <system.web>
      <authorization>
        <allow roles="user,client,admin"/>
        <deny users="*"/>
        <deny users="?"/>
      </authorization>
    </system.web>
  </location>
  <location path="ws/__ws_eq.asmx">
    <system.web>
      <authorization>
        <allow roles="user,client,admin"/>
        <deny users="*"/>
        <deny users="?"/>
      </authorization>
    </system.web>
  </location>
</configuration>

Below is the root Web.config settings

<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
    <connectionStrings>
        <add name="dbcloudintegraConnectionStringb" connectionString="Data Source=PROGRAMOS-PC\INST1;Initial Catalog=dbcloudintegra;Persist Security Info=True;User ID=sa;Password=p@ssw0rd" providerName="System.Data.SqlClient" />
        <add name="dbcloudintegraConnectionString" connectionString="Data Source=PROGRAMOS-PC\INST1;Initial Catalog=prom_temprary;Persist Security Info=True;User ID=sa;Password=p@ssw0rd" providerName="System.Data.SqlClient" />
    </connectionStrings>
    <location path="default.aspx">
        <system.web>
            <authorization>
                <allow roles="user,admin"/>
                <deny users="*"/>
                <deny users="?"/>
            </authorization>
        </system.web>
    </location>
    <location path="__upload.aspx">
        <system.web>
            <authorization>
                <allow roles="user,admin"/>
                <deny users="*"/>
                <deny users="?"/>
            </authorization>
        </system.web>
    </location>
    <appSettings>
        <add key="_cs" value="dbcloudintegraConnectionString"/>
        <add key="fileuploads" value="D:\Users\Chibuzo\Documents\prog_fileuploads\"/>
        <add key="errorlogs" value="D:\Users\Chibuzo\Documents\prog_errorlogs\"/>
        <add key="enableLogOn" value="true"/>
        <add key="enableRecaptcha" value="false"/>
        <add key="domainAdminDays" value="5000"/>
        <add key="domainPath" value="http://www.prominentetrade.com/"/>
        <add key="recaptchaPublicKey" value="6LcZkvESAAAAAOWvWUtykUEoIGnU_qLiJlAvUN9e"/>
        <add key="recaptchaPrivateKey" value="6LcZkvESAAAAAIBTKFXnqZHe_bqFLkwjtZfcgqoV"/>
    </appSettings>
    <system.web>
        <sessionState cookieName="__CIP.SSID" timeout="20"/>
        <customErrors mode="Off" defaultRedirect="~/500.aspx">
            <error statusCode="404" redirect="~/404.aspx"/>
        </customErrors>
        <pages>
            <controls>
                <add tagPrefix="cloudintegra" src="~/controls/datepicker.ascx" tagName="datepicker"/>
                <add tagPrefix="cloudintegra" src="~/controls/customersearch.ascx" tagName="customersearch"/>
                <add tagPrefix="cloudintegra" src="~/controls/generalledgersearch.ascx" tagName="generalledgersearch"/>
                <add tagPrefix="cloudintegra" src="~/controls/staffsearch.ascx" tagName="staffsearch"/>
                <add tagPrefix="cloudintegra" src="~/controls/securitysearch.ascx" tagName="securitysearch"/>
                <add tagPrefix="cloudintegra" src="~/controls/alert.ascx" tagName="alert"/>
                <add tagPrefix="cloudintegra" src="~/controls/sidebar.ascx" tagName="sidebar"/>
                <add tagPrefix="cloudintegra" src="~/controls/tools.ascx" tagName="tools"/>
                <add tagPrefix="cloudintegra" src="~/controls/equitytrader.ascx" tagName="equitytrader"/>
                <add tagPrefix="cloudintegra" src="~/controls/marketdata.ascx" tagName="marketdata"/>
            </controls>
        </pages>
        <compilation debug="true" targetFramework="4.0">
            <assemblies>
                <add assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
                <add assembly="CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
                <add assembly="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
                <add assembly="CrystalDecisions.ReportAppServer.Controllers, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
                <add assembly="CrystalDecisions.ReportAppServer.DataDefModel, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
                <add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
                <add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
                <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            </assemblies>
            <codeSubDirectories>
                <add directoryName="VB"/>
            </codeSubDirectories>
        </compilation>
        <authentication mode="Forms">
            <forms name="__AUTH.PCI" loginUrl="~/login.aspx" slidingExpiration="true" timeout="20"/>
        </authentication>
        <membership>
            <providers>
                <remove name="AspNetSqlMembershipProvider"/>
                <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="dbcloudintegraConnectionString" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" applicationName="cloudintegra" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression=""/>
            </providers>
        </membership>
        <profile>
            <providers>
                <clear/>
                <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="dbcloudintegraConnectionString" applicationName="cloudintegra"/>
            </providers>
        </profile>
        <roleManager enabled="true">
            <providers>
                <clear/>
                <add connectionStringName="dbcloudintegraConnectionString" applicationName="cloudintegra" name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider"/>
                <add applicationName="cloudintegra" name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider"/>
            </providers>
        </roleManager>
        <webServices>
            <protocols>
                <!--<add name="HttpGet"/>-->
                <add name="HttpPost"/>
            </protocols>
        </webServices>
        <httpHandlers>
            <add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
        </httpHandlers>
        <!--<httpModules>
      <add name="Session" type="System.Web.SessionState.SessionStateModule"/>
    </httpModules>-->
        <httpRuntime requestValidationMode="2.0"/>
    </system.web>
    <system.web.extensions>
        <scripting>
            <webServices>
                <jsonSerialization maxJsonLength="2147483647"></jsonSerialization>
            </webServices>
        </scripting>
    </system.web.extensions>
    <system.webServer>
        <handlers>
            <add name="CrystalImageHandler.aspx_GET" verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" preCondition="integratedMode"/>
        </handlers>
        <validation validateIntegratedModeConfiguration="false"/>
        <staticContent>
            <mimeMap fileExtension=".woff" mimeType="application/octet-stream"/>
        </staticContent>
    </system.webServer>
    <system.net>
    </system.net>
</configuration>

How can I solve this problem?

EDIT: From Andrew's answer, I found out that my IIS pool was set to .NET 2.0, so I changed it to 4.0. I still get internal Server Error, but it has changed.

Error Code  0x80070021
Config Error    This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".

Below is the screen shoot of the current errorenter image description here

c#
asp.net
visual-studio-2010
asked on Stack Overflow Jan 25, 2015 by Chibuzo • edited Jan 25, 2015 by Chibuzo

4 Answers

1

Adding this as answer since its a bit longer to comment

<configuration> <configSections> <section name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup" /> </configSections> </configuration>

Try adding this to applicationHost.config

Also check your others paths are local in all config files

answered on Stack Overflow Jan 25, 2015 by Polynomial Proton
1

As a quick Workaround you could add the following to your root web.config:

<configuration>
    <!-- add the missing section definitions as stated in the error message -->
    <configSections>
        <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
            <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
                <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
                <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
                    <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere"/>
                </sectionGroup>
            </sectionGroup>
        </sectionGroup>
    </configSections>
...

But that's just a workaround. Usually these sections should be already declared in your machine.config. That file's located here: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config

Edit: It's surprising me, that adding these lines to your root web.config doesn't make any differences and you still get that error message...

But as Andrew already said in his answer this error can have many causes.

I faced a similar situation when I worked on a web application that was hosted as a separate application inside a site. The structure was like the following:

theSite
├subDir1
├subDir2
└─seperateApplication

theSite had its own web.config with some special configscetions within and so on, and my seperateApplication had issues because being in a sub-directory of theSite led to inherting all those web.config-settings.

To cut a long story short, make sure that your application doesn't inherit some odd settings from another site which possibly removed those sections via <remove name="system.web.extensions" /> or something like that.

answered on Stack Overflow Jan 25, 2015 by khlr • edited May 23, 2017 by Community
1

One reason this error can occur is if the Application was developed for .Net 4.0 but is running on an IIS Application pool set to .Net 3.5. Check the settings for your application pool and/or verify that .Net 4.0 is installed on the machine you moved the application to.

Also note, the HTTP error code 500.19 can have many different causes, and the IIS error code 0x80070032 is the more specific cause of the issue. There is a fairly lengthy discussion of error 0x80070032 at http://forums.iis.net/t/1166889.aspx

answered on Stack Overflow Jan 25, 2015 by Claies
1

I had the same thing, but the fix was straightforward. I had to make two adjustments that had been saved in the solution and didn't match to the new location I moved it to. The adjustments were as follows:

1.) After transferring to the new local drive location I opened the solution in VS. In the top nav. clicked Tools -> Options -> See a popup. On the left of that "Option" popup, go to "Project and Solutions" -> "General" -> on the right, see 3 text input fields, update the "Projects location" by browsing to the folder where the solution placed when moved. (note, I did not update the two template locations) Save and Close

2.)(Optional) My solution had 2 projects, a project as a ui layer using the localhost and another as a business layer made as a class library; the ui layer being a web app, needed its virtual directory to be recreated. I did the following: Right click the project that was the ui layer --> click projects properties to see the properties tab -> On the left of that tab is a nav list-> Click "Web"-> On the right under the section titled "Server", click "Create Virtual Directory" to rebuild it. Save, exit Then all was good and no errors and everything was running again The only catch I had was in regards to saved breakpoints. I had to remove all saved breakpoints and re-establish.

answered on Stack Overflow Apr 8, 2015 by Jason Ashley • edited May 3, 2015 by Jason Ashley

User contributions licensed under CC BY-SA 3.0