Monday, March 26, 2012

Web.config problem

I have a webconfig that is using a sqlserver 2005 that has my data, and a local sqlserver express for login of user aspnetdb. First of all, I'm not sure if this is what I have to do to maintain users (I mean have a seperate local aspnetdb database for login users and have another sqlserver database called WareHouse to keep my data)? I configured my webconfig as shown below but I keep getting errors when I rebuild saying :

Error 81 It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. C:\Documents and Settings\pateln.PROB\My Documents\Visual Studio 2005\WebSites\WH\WareHouse\web.config 21

It seems like it doesn't like two different sqlservers. I'm I on the wrong track? Here is my webconfig file:

<

configurationxmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

<

configSections>

<

sectionname="netTiersService"type="NetTier.DAL.Bases.NetTiersServiceSection, NetTier.DAL"/>

</

configSections>

<

connectionStrings>

<

removename="aspnetdbConnectionString"/>

<

addname="aspnetdbConnectionString"connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=aspnetdb;Integrated Security=True"providerName="System.Data.SqlClient"/>

<

addname="WareHouseConnectionString"connectionString="Data Source=PROB001\SQL2005TEST;Initial Catalog=WareHouse;Integrated Security=True"providerName="System.Data.SqlClient"/>

</

connectionStrings>

<

appSettings/>

<

system.web>

<

membershipdefaultProvider="LocalMembershipProvider">

<

providers>

<

addconnectionStringName="aspnetdbConnectionString"enablePasswordRetrieval="false"enablePasswordReset="true"requiresQuestionAndAnswer="false"applicationName="/"requiresUniqueEmail="false"passwordFormat="Hashed"maxInvalidPasswordAttempts="5"minRequiredPasswordLength="5"minRequiredNonalphanumericCharacters="0"passwordAttemptWindow="10"passwordStrengthRegularExpression=""name="LocalMembershipProvider"type="System.Web.Security.SqlMembershipProvider"/>

</

providers>

</

membership>

<

compilationdebug="true">

<authenticationmode="Forms">

<

formsloginUrl="~/WH/login.aspx"/>

</

authentication>

</

system.web>

<

netTiersServicedefaultProvider="SqlNetTiersProvider">

<

providers>

<

addname="SqlNetTiersProvider"type="NetTier.DAL.SqlClient.SqlNetTiersProvider, NetTier.DAL.SqlClient"useStoredProcedure="true"connectionStringName="WareHouseConnectionString"applicationName="WareHouseWeb"providerInvariantName="System.Data.SqlClient"/>

</

providers>

</

netTiersService>

</

configuration>

Can someone tell me if I'm on the right track as far as keeping 2 different databases on 2 different servers and why I keep getting my errors in webconfig everytime I rebuild my website.

Thanks You

Nick

Try configuring IIS to see your virtual directory as an application. Go to IIS, right click your virtual directory and next to 'application name', click on the button that says 'create'.

Regarding your two database architecture, it really is up to you to decide what the best set up will be. If you are planning to share the login information with other application, it may be a better idea to keep it as a separate database, though


I tried the IIS configuration. There wasn't a create button but I went through a wizard and created the virtual directory on IIS. But the problem still exist. Also there is only one web.config and no other backups in the websites directory.

thanks

Nick


What version of IIS are you using?


I am running IIS 5.1. It seems like its behaving now. Can't explain why it throws a fit on and off. Thanks for all your help

Nick

0 comments:

Post a Comment