0

This should be easy... but I am missing something.

Currently, I have a website "running" asp.net 4.0, on shared server. Need to migrate site to another hosting company, but new one does not have same setup (limited use of virtual directory).

The site is setup on the server like this

./root/directory/subdir1/subdir2/*.aspx (webconfig here as well)

We have a virtual directory "vdir = directory/subdir1/subdir2" that allows us to keep the url simple, looking like

https://www.url.com/vdir/default.aspx

Multiple attempts, hours later, not able to resolve. Error is 500/40x, depending on setup.

What is best way to setup my web.configs?? I do not have access to root, server IIS.

Webconfig below.

Any suggestion is appreciated!

Good resource:

http://weblogs.asp.net/jongalloway/10-things-asp-net-developers-should-know-about-web-config-inheritance-and-overrides

<?xml version="1.0" encoding="utf-8"?>
<configuration>

  <connectionStrings>
    <add name="ApplicationServices" connectionString="Data Source=*;Initial Catalog=*;Persist Security Info=True;User ID=*;Password=*" providerName="System.Data.SqlClient"/>
 </connectionStrings>


  <system.web>

    <sessionState cookieless="AutoDetect" timeout="60" compressionEnabled="true"/>

    <compilation debug="true" targetFramework="4.0" />

    <authentication mode="Forms">
      <forms cookieless="AutoDetect" name=".AuthCookie" protection="All" path="/" loginUrl="~/Account/Login.aspx" defaultUrl="~/Default.aspx" timeout="60" slidingExpiration="true"/>
    </authentication>

    <machineKey validationKey="*"
                decryptionKey="*"
                validation="SHA1"
                decryption="AES"/>

    <membership defaultProvider="AspNetMembershipProvider" userIsOnlineTimeWindow="60">
      <providers>
        <clear />
        <add name="AspNetMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7"  minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="a" />
      </providers>
    </membership>

    <profile defaultProvider="AspNetSqlProfileProvider" enabled="true">

      <providers>
        <clear />
        <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="a" />
      </providers>

    </profile>

    <roleManager enabled="true" defaultProvider="AspNetSqlRoleProvider">
      <providers>
        <clear />
        <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="a" />
        <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="a" />
      </providers>
    </roleManager>

    <authorization>
      <deny users="?" />
      <allow users="*" />
    </authorization>


  </system.web>

  <location path="account">
    <system.web>
      <authorization>
        <deny users="?" />
        <allow users="*" />
      </authorization>
    </system.web>
  </location>


  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true" />
  </system.webServer>

</configuration>

UPDATE#1

1) tried in a parent/root path. Subdirectory/application asp does not render

2) tried creating web.confing at top /root, but didn't render

 <location path="sub1/sub2r">
    <system.web>
      <authorization>
        <allow users="*" />
      </authorization>
    </system.web>
  </location>

3) created test.html file (simple html text/tags). Viewable at any location, directory, under and conditions... but simple aspx pages, in same locations, not running.

UPDATE #2 Tested basic fundamentals of the authorization, by folder, file, etc. Can view/see all folders, permissions work, network services, roles, etc all setup correct. Bottom line is that my web.config file can not be seen, because if does not have proper permission.

Still trying to find out how to resolve.

brian1
  • 165
  • 1
  • 10
  • Can you post the actual error you are getting? – Aaron Oct 18 '15 at 15:41
  • @Aaron 500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed. – brian1 Oct 18 '15 at 15:57
  • 1
    It probably has to do with web config inheritance. I'd start with these two links. [SO Question](http://stackoverflow.com/questions/782252/avoid-web-config-inheritance-in-child-web-application-using-inheritinchildapplic). [MSDN](https://msdn.microsoft.com/en-us/library/ms178685.aspx). You maybe having a conflict with the same item being added once by the parent and once by the child web config – Aaron Oct 18 '15 at 17:27
  • @Aaron Thanks for suggestions/links. Tried some of these (that hadn't tried before). Something is just fundamentally not working. Still getting 500 error.. – brian1 Oct 18 '15 at 18:00
  • It usually comes down to determining what needs to be "cleared" from the primary site's web.config. (Though, full disclosure, I've never had good luck running a full site within a sub-site as a virtual directory). – Brad Christie Oct 18 '15 at 18:17
  • @BradChristie - That's what it looks like. have set all of the handlers (that I can) to clear, checked all "parent" folder settings and child settings. Tough to isolate. thanks – brian1 Oct 18 '15 at 22:44

0 Answers0