web.config question


M

Manuel

Hi to all,
I'm new in asp.net and have a problem with deploy of my application.
If I up on the my server the file *.aspx and *.cs it will run perfectly,
but if I try up a web.config it give this an error page:

Server Error in '/' Application.
Runtime Error
Description: 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.

Now I'm working with a database and need to up a web.config, in visual
studio it run perfecly using remote db too.Follow the config file to up:

<configuration>
<appSettings/>
<connectionStrings>
<add name="mysqlConnString" connectionString="Database=membership;Data
Source=$MyAddress$;User Id=adm;Password=$MyPass$"/>
</connectionStrings>
<system.web>
<compilation debug="false" />
<authentication mode="Forms">
<forms loginUrl="~/Examples/login.aspx" name=".ASPXFORMSAUTH" />
</authentication>
<machineKey validationKey="AutoGenerate,IsolateApps"
decryptionKey="AutoGenerate,IsolateApps" validation="SHA1"/>

<roleManager defaultProvider="MySqlRoleProvider" enabled="true"
cacheRolesInCookie="true" cookieName=".ASPROLES" cookieTimeout="30"
cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true"
cookieProtection="All">
<providers>
<clear/>
<add
name="MySqlRoleProvider"
connectionStringName="mysqlConnString"
applicationName="YOURAPPNAME"
type="Andri.Web.MySqlRoleProvider"
/>
</providers>
</roleManager>
<membership defaultProvider="MySqlMembershipProvider">
<providers>
<clear />
<add
connectionStringName="mysqlConnString"
applicationName="YOURAPPNAME"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
requiresUniqueEmail="true"
passwordFormat="Clear"
name="MySqlMembershipProvider"
encryptionKey="AB56FE8EA700B42A"
type="Andri.Web.MySqlMembershipProvider"
/>
</providers>
</membership>
</system.web>
</configuration>

Any suggestion?

Thanks in advance
 
Ad

Advertisements

J

Juan T. Llibre

Is the application marked as an ASP.NET 2.0 app ?

In the IIS Manager, check the app's properties and make sure that
it's running against the .Net Framework 2.0 and not agains 1.1.

Also, since you apparently are accessing the site remotely with your browser,
add this to the site's web.config :

<customErrors mode="RemoteOnly" />

Add it anywhere within the <system.web> </system.web> tags

That will allow you to see the error being generated.




Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
 
A

Alexey Smirnov

Hi to all,
I'm new in asp.net and have a problem with deploy of my application.
If I up on the my server the file *.aspx and *.cs it will run perfectly,
but if I try up a web.config it give this an error page:

Server Error in '/' Application.
Runtime Error
Description: 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.

Now I'm working with a database and need to up a web.config, in visual
studio it run perfecly using remote db too.Follow the config file to up:

<configuration>
<appSettings/>
<connectionStrings>
<add name="mysqlConnString" connectionString="Database=membership;Data
Source=$MyAddress$;User Id=adm;Password=$MyPass$"/>
</connectionStrings>
<system.web>
<compilation debug="false" />
<authentication mode="Forms">
<forms loginUrl="~/Examples/login.aspx" name=".ASPXFORMSAUTH" />
</authentication>
<machineKey validationKey="AutoGenerate,IsolateApps"
decryptionKey="AutoGenerate,IsolateApps" validation="SHA1"/>

<roleManager defaultProvider="MySqlRoleProvider" enabled="true"
cacheRolesInCookie="true" cookieName=".ASPROLES" cookieTimeout="30"
cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true"
cookieProtection="All">
<providers>
<clear/>
<add
name="MySqlRoleProvider"
connectionStringName="mysqlConnString"
applicationName="YOURAPPNAME"
type="Andri.Web.MySqlRoleProvider"
/>
</providers>
</roleManager>
<membership defaultProvider="MySqlMembershipProvider">
<providers>
<clear />
<add
connectionStringName="mysqlConnString"
applicationName="YOURAPPNAME"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
requiresUniqueEmail="true"
passwordFormat="Clear"
name="MySqlMembershipProvider"
encryptionKey="AB56FE8EA700B42A"
type="Andri.Web.MySqlMembershipProvider"
/>
</providers>
</membership>
</system.web>
</configuration>

Any suggestion?

Thanks in advance

Add a new key to the <system.web>:

<customErrors mode="Off"/>

it helps to see the error.

P.S. you don't need to deploy .cs files
 
M

Manuel

Thanks for the your attention. The result is:

Parser Error Message: 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.

Source Error:


Line 20:
Line 21: <compilation debug="false" />
Line 22: <authentication mode="Forms">
Line 23: <forms loginUrl="~/Examples/login.aspx" name=".ASPXFORMSAUTH" />
Line 24: </authentication>

I have a server with a plesk panel, I'm not sure of the possibility to
set a virtual directory.

Alexey Smirnov ha scritto:
 
M

Manuel

Thanks for the your attention. The result is:

Parser Error Message: 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.

Source Error:


Line 20:
Line 21: <compilation debug="false" />
Line 22: <authentication mode="Forms">
Line 23: <forms loginUrl="~/Examples/login.aspx"
name=".ASPXFORMSAUTH" />
Line 24: </authentication>

I have a server with a plesk panel, I'm not sure of the possibility to
set a virtual directory.
 
Ad

Advertisements

M

Manuel

Thanks all those that have helped me, I have solved building a new
virtual directory in the configuration panel.Was simple!
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top