locked
can not download project to web site due to two many redirects. RRS feed

  • Question

  • User-605499000 posted

    I am using asp.net c# in visual studio 2017.  I am trying to get it on my site by downloading the project using filzilla.  The error is in the web config file that redirects to the error file and does not let me open the site. Below is part where the problem is.  I have tried the mode as On, remote only and off.

    <system.web>
    <customErrors mode="Off" defaultRedirect="ErrorPage.aspx?handler=customErrors%20section%20-%20Web.config">
    <error statusCode="404" redirect="ErrorPage.aspx?msg=404&amp;handler=customErrors%20section%20-%20Web.config" />
    </customErrors>

    When I used off I get the below message a security problem.

    An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

    I used wingtop toys a Microsoft program to help build my site. I am using there error file and it worked for them.
    If I take the error page out it involves parts of four other files and then I get a security issue.

    What do I do to get my project up on my site. When I open the wingtop file no problems on the browsers everything is fine.
    Below is the total web config. Also no problem when I open my site bumples on the browsers, there is not problem.
    Thanks for your help.
    Jen

    Web.com where I load my site says that I need to open the whole file at once but filziller has me loading files and Microsoft says to load files separately.

    <configuration>
    <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" />
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <sectionGroup name="elmah">
    <section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
    <section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
    <section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
    <section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" />
    </sectionGroup></configSections>
    <connectionStrings>
    <add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-Bumples;Integrated Security=True" providerName="System.Data.SqlClient" />
    <add name="Bumples" connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\bumples.mdf;Integrated Security=True" providerName="System.Data.SqlClient" />
    </connectionStrings>
    <system.web>
    <customErrors mode="Off" defaultRedirect="ErrorPage.aspx?handler=customErrors%20section%20-%20Web.config">
    <error statusCode="404" redirect="ErrorPage.aspx?msg=404&amp;handler=customErrors%20section%20-%20Web.config" />
    </customErrors>
    <authentication mode="None" />
    <compilation debug="true" defaultLanguage="c#" optimizeCompilations="true" targetFramework="4.6.1" />
    <httpRuntime targetFramework="4.6.1" />
    <pages>
    <namespaces>
    <add namespace="System.Web.Optimization" />
    <add namespace="Microsoft.AspNet.Identity" />
    </namespaces>
    <controls>
    <add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt" />
    </controls>
    </pages>
    <profile defaultProvider="DefaultProfileProvider">
    <providers>
    <add name="DefaultProfileProvider" type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" />
    </providers>
    </profile>
    <membership defaultProvider="DefaultMembershipProvider">
    <providers>
    <add name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
    </providers>
    </membership>
    <roleManager defaultProvider="DefaultRoleProvider">
    <providers>
    <add name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" />
    </providers>
    </roleManager>
    <!--
    If you are deploying to a cloud environment that has multiple web server instances,
    you should change session state mode from "InProc" to "Custom". In addition,
    change the connection string named "DefaultConnection" to connect to an instance
    of SQL Server (including SQL Azure and SQL Compact) instead of to SQL Server Express.
    -->
    <sessionState mode="InProc" customProvider="DefaultSessionProvider">
    <providers>
    <add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" />
    </providers>
    </sessionState>
    <httpModules>
    <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
    <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
    <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" />
    </httpModules></system.web>
    <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
    <assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" />
    <bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
    </dependentAssembly>
    <dependentAssembly>
    <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" />
    <bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
    </dependentAssembly>
    <dependentAssembly>
    <assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" />
    <bindingRedirect oldVersion="0.0.0.0-4.0.2.1" newVersion="4.0.2.1" />
    </dependentAssembly>
    <dependentAssembly>
    <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
    </dependentAssembly>
    <dependentAssembly>
    <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
    </dependentAssembly>
    <dependentAssembly>
    <assemblyIdentity name="Microsoft.Owin.Security.OAuth" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
    </dependentAssembly>
    <dependentAssembly>
    <assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
    </dependentAssembly>
    <dependentAssembly>
    <assemblyIdentity name="Microsoft.Owin.Security.Cookies" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
    </dependentAssembly>
    </assemblyBinding>
    </runtime>
    <system.codedom>
    <compilers>
    <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701" />
    <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
    </compilers>
    </system.codedom>
    <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
    <parameters>
    <parameter value="v11.0" />
    </parameters>
    </defaultConnectionFactory>
    <providers>
    <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
    </providers>
    </entityFramework>
    <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules>
    <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
    <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" />
    <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" />
    </modules>
    </system.webServer><elmah>
    <!--
    See http://code.google.com/p/elmah/wiki/SecuringErrorLogPages for
    more information on remote access and securing ELMAH.
    -->
    <security allowRemoteAccess="false" />
    </elmah><location path="elmah.axd" inheritInChildApplications="false">
    <system.web>
    <httpHandlers>
    <add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
    </httpHandlers>
    <!--
    See http://code.google.com/p/elmah/wiki/SecuringErrorLogPages for
    more information on using ASP.NET authorization securing ELMAH.

    <authorization>
    <allow roles="admin" />
    <deny users="*" />
    </authorization>
    -->
    </system.web>
    <system.webServer>
    <handlers>
    <add name="ELMAH" verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode" />
    </handlers>
    </system.webServer>
    </location></configuration>



    Tuesday, March 12, 2019 10:12 PM

All replies

  • User475983607 posted

    This is an IIS confirmation error.  You are trying to access a folder that does not have an default file.  IIS is configured to NOT show the files.  The error probably has nothing to do with redirects or downloading the application.

    Tuesday, March 12, 2019 11:12 PM
  • User-893317190 posted

    Hi bumples18,

    It is not clear about your problem.It only shows An application error occurred on the server.

    To enable detailed error message , you could set customErrors mode="Off"(to debug please remove the redirecting config) or set ttpErrors errorMode="Detailed".

    For more information , please refer to the link https://stackoverflow.com/questions/5385714/deploying-website-500-internal-server-error/5385884#5385884

    Best regards,

    Ackerly Xu

    Wednesday, March 13, 2019 3:26 AM
  • User-605499000 posted

    Thanks for your help. I do have a default file but you have put me onto the IIS confirmation error and I am now checking into that side. Right now it is a 401 error so hopefully getting closer.

    Thanks 

    Jen

    Thursday, March 14, 2019 4:56 PM
  • User-605499000 posted

    Thaanks I think that you have put me on the right track and I am checking it. Also going to try the web code that was on the stackoverflow.

    Right now I am getting a 401 error.  This is so hard, don't know what I would have done without your support.

    Jen

    Thursday, March 14, 2019 4:58 PM
  • User-605499000 posted

    I just got another error which I don't understand. Do I need a codedom provider or can I take that out.   When I started this project it was put into my web conf.  

    Here is the error::

    An application error occurred on the server. The current custom error settings for this application prevent the details of the appl

    ication error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

    I hope this ends the problem.

    Thanks,

    Jen

    Thursday, March 14, 2019 7:59 PM
  • User-605499000 posted

    I just got another error which I don't understand. Do I need a codedom provider or can I take that out.   When I started this project it was put into my web conf.  

    Here is the error::

    An application error occurred on the server. The current custom error settings for this application prevent the details of the appl

    ication error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

    I hope this ends the problem.

    Thanks,

    Jen

    Thursday, March 14, 2019 8:00 PM
  • User-893317190 posted

    Hi bumples18,

    The error shows you are still not able to see the error message from remote server.

    How does you edit your web.config at root path?

    Please check this  to learn how to enable remote detailed error message https://community.appian.com/support/w/kb/348/kb-1126-how-to-display-detailed-error-messages-in-iis

    Best regards,

    Ackerly Xu

    Friday, March 15, 2019 1:23 AM
  • User-605499000 posted

    I downloaded IIs console and followed the directions.  I think I fixed a 500 error but when I open my website I am getting 21 redirects.

    ErrorPage.aspx  Protocol Http Method Get 302 found.   The console does not show any errors but in the networking I get  the 302.

    I do not know what to do. the ErrorPage was copied from Wingtip toys and it worked for them.  In the web config I put it on off.  

    Is there any hope or do I have to start a new web site?  

    Jen

    Saturday, March 16, 2019 1:31 AM
  • User-893317190 posted

    Hi bumples18,

    Are you sure the browser redirects you to your ErrorPage.aspx?

    Open F12 to see whether it shows 200 ok or 404 when redirecting you to ErrorPage.aspx.

    Have you set the path of your error page correctly ?

    Please add "~/" before your error page , refer to https://stackoverflow.com/questions/7269103/problem-with-defaultredirect-in-web-config-customerrors

    You could also configure using iis manager https://forums.iis.net/t/1160614.aspx

    Best regards,

    Ackerly Xu

    Monday, March 18, 2019 1:19 AM
  • User-605499000 posted

    I want to thank you once again for all of your help. I will try what you suggested and I was using IIs manager. I did fix a few minor things but then when I would try to open it still said no but also said no mistakes which IIS also came back with.

    I have decided to open a new file and move the files over slowly that I now are good and go from there.  This problem is so far above me and although I have learned a lot in 3 weeks, I need to move on and get the site up somehow. I have gotten rid of bootstrap because I think it was causing problems with css and javascript files. the magazine is all javascript and I was running into problems with animation and games that are part of the story. They had all worked before. 

    Thanks again and hopefully my new site will not have the problems. 

    Monday, March 18, 2019 1:55 PM