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

Chibuzo
  • 6,112
  • 3
  • 29
  • 51

4 Answers4

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

Polynomial Proton
  • 5,020
  • 20
  • 37
  • Thanks for the answer. I'm fairly new to ASP.NET, I can't seem to find applicationHost.config, please where do I look? – Chibuzo Jan 25 '15 at 10:12
  • Its either applicationHost.config or app.config. – Polynomial Proton Jan 25 '15 at 10:14
  • 1
    I dont remeber but i think its in AppData folder. Not sure if this will help : http://stackoverflow.com/questions/13043530/what-is-app-config-in-c-net-how-to-use-it – Polynomial Proton Jan 25 '15 at 10:19
  • I've seen it, added it, still getting the same error. – Chibuzo Jan 25 '15 at 10:23
  • Exact same? Try restarting development server/ recycle app pool. If still doesnt work try adding above code it in web.config. – Polynomial Proton Jan 25 '15 at 10:27
  • Hey this can be an issue with iis. Check your app pool is set properly and .net framework is activated. Also try adding the code i gave in iis's applicationHost. Read this : http://www.aspdotnet-suresh.com/2011/05/requested-page-cannot-be-accessed.html?m=1 – Polynomial Proton Jan 25 '15 at 10:36
  • Thanks. The error message has changed after I changing the app pool setting. I edited my question to show the new issue. Please look at it. – Chibuzo Jan 25 '15 at 11:40
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/69548/discussion-between-chibuzo-and-theuknown). – Chibuzo Jan 25 '15 at 12:13
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.

Community
  • 1
  • 1
Jan Köhler
  • 5,817
  • 5
  • 26
  • 35
  • Thanks for the answer, I've added it to root the Web.config, but I'm still getting the same error. – Chibuzo Jan 25 '15 at 10:24
  • Take a look at my edited answer. This applies to your edited question, too. – Jan Köhler Jan 25 '15 at 12:10
  • Still haven't resolved it yet. I created a new question, please take a look. http://stackoverflow.com/questions/28137390/iis-locking-possibly-causing-asp-net-project-to-throw-http-error-500-19 – Chibuzo Jan 25 '15 at 14:20
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

Claies
  • 22,124
  • 4
  • 53
  • 77
  • Thanks Andrew for the answer. I've changed the .NET version, I am getting a different error now. I've edited my question to include it. Please look at it. Thank you. – Chibuzo Jan 25 '15 at 11:39
  • 1
    you really should create a new question related to the new error to avoid confusion. however, the new error is related to IIS Locking, and you can read a bit about it at http://www.iis.net/learn/get-started/planning-for-security/how-to-use-locking-in-iis-configuration – Claies Jan 25 '15 at 11:53
  • Thanks Andrew. I've created a new question related to the new error. Please take a look. http://stackoverflow.com/questions/28137390/iis-locking-possibly-causing-asp-net-project-to-throw-http-error-500-19 – Chibuzo Jan 25 '15 at 14:19
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.

Jason Ashley
  • 631
  • 6
  • 8