Monday, March 26, 2012

web.config question

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 advanceIs 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 espaol : http://asp.net.do/foros/
======================================
"Manuel" <vanilla.in@.the.sky> wrote in message news:P1j1i.5694$%k.41681@.twister2.libero.it.
.
> 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, b
ut 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 cust
om error settings for
> this application prevent the details of the application error from being v
iewed 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 stu
dio it run perfecly
> using remote db too.Follow the config file to up:
> <configuration>
> <appSettings/>
> <connectionStrings>
> <add name="mysqlConnString" connectionString="Database=membership;Data Sou
rce=$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="AutoGe
nerate,IsolateApps"
> validation="SHA1"/>
> <roleManager defaultProvider="MySqlRoleProvider" enabled="true" cacheRoles
InCookie="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
On May 12, 3:11 pm, Manuel <vanilla...@.the.sky> wrote:
> 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=mem
bership;Data
> Source=$MyAddress$;User Id=adm;Password=$MyPass$"/>
> </connectionStrings>
> <system.web>
> <compilation debug="false" />
> <authentication mode="Forms">
> <forms loginUrl="~/Examples/login.aspx" name=".ASP
XFORMSAUTH" />
> </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="mysqlConnStr
ing"
> applicationName="YOURAPPNAME"
> type="Andri.Web.MySqlRoleProvider"
> />
> </providers>
> </roleManager>
> <membership defaultProvider="MySqlMembershipProvider">
> <providers>
> <clear />
> <add
> connectionStringName="mysqlConnStr
ing"
> applicationName="YOURAPPNAME"
> enablePasswordRetrieval="false"
> enablePasswordReset="true"
> requiresQuestionAndAnswer="true"
> requiresUniqueEmail="true"
> passwordFormat="Clear"
> name="MySqlMembershipProvider"
> encryptionKey="AB56FE8EA700B42A"
> type="Andri.Web.MySqlMembershipPro
vider"
> />
> </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
re:
> <customErrors mode="RemoteOnly" />
That's a typo produced by a mistaken cut-and-paste.
As Alexei just pointed out,
<customErrors mode="Off" />
...is more helpful in allowing the error to be displayed.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
======================================
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:%23qFxY6JlHHA.1624@.TK2MSFTNGP06.phx.gbl...
> 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 brows
er,
> 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 espaol : http://asp.net.do/foros/
> ======================================
> "Manuel" <vanilla.in@.the.sky> wrote in message news:P1j1i.5694$%k.41681@.tw
ister2.libero.it...
>
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:
> On May 12, 3:11 pm, Manuel <vanilla...@.the.sky> wrote:
> 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
>
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.

> re:
> That's a typo produced by a mistaken cut-and-paste.
> As Alexei just pointed out,
> <customErrors mode="Off" />
> ...is more helpful in allowing the error to be displayed.
>
>
>
> Juan T. Llibre, asp.net MVP
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en espaol : http://asp.net.do/foros/
> ======================================
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
> news:%23qFxY6JlHHA.1624@.TK2MSFTNGP06.phx.gbl...
>
Thanks all those that have helped me, I have solved building a new
virtual directory in the configuration panel.Was simple!

> 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
The solution, of course, is to create an IIS application
which points to the physical directory where your web site resides.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
======================================
"Manuel" <vanilla.in@.the.sky> wrote in message news:f7p1i.5882$U01.86517@.twister1.libero.it
..
> 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 err
or 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=".ASPXFO
RMSAUTH" />
> Line 24: </authentication>
> I have a server with a plesk panel, I'm not sure of the possibility to set
a virtual directory.
>

0 comments:

Post a Comment