Publishing WebForms to Production System

A

A P

Hi!

I'm using ASP.Net Web Matrix on my PC and wanting to publish the files to
our server. I try to copy (thru explorer) the files but it didn't work! I
receive Runtime Error:


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.

Details: To enable the details of this specific error message to be viewable
on remote machines, please create a <customErrors> tag within a "web.config"
configuration file located in the root directory of the current web
application. This <customErrors> tag should then have its "mode" attribute
set to "Off".


<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>


Notes: The current error page you are seeing can be replaced by a custom
error page by modifying the "defaultRedirect" attribute of the application's
<customErrors> configuration tag to point to a custom error page URL.


<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>



What did I do wrong? Or what is the proper way of publishing .Net Web
documents to the production server?
 
J

Juan T. Llibre

You are getting that message, not because you've
published your files incorrectly, but because you have
an error in your default application's page.

In order to see the source of that error, you need
to modify your web.config file as instructed :

<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>

and upload the modified web.config file to your server.

*Then* you will be able to see what the source for
your error is, unless your ISP doesn't allow for
application errors to be displayed.

The only way to find out, is to upload the
modified web.comfig file to the server,
and trying to access your application again.




Juan T. Llibre
ASP.NET MVP
===========
 
A

A P

Its already Off but same error message. I've tried opening the page on the
server and I find different error message. Btw, here is my current WebConfig
File:

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

<configuration>


<system.web>

<!-- DYNAMIC DEBUG COMPILATION

Set compilation debug="true" to insert debugging symbols (.pdb information)

into the compiled page. Because this creates a larger file that executes

more slowly, you should set this value to true only when debugging and to

false at all other times. For more information, refer to the documentation
about

debugging ASP.NET files.

-->

<compilation defaultLanguage="vb" debug="true" />

<!-- CUSTOM ERROR MESSAGES

Set customErrors mode="On" or "RemoteOnly" to enable custom error messages,
"Off" to disable.

Add <error> tags for each of the errors you want to handle.

-->

<customErrors mode="Off" />

<!-- AUTHENTICATION

This section sets the authentication policies of the application. Possible
modes are "Windows",

"Forms", "Passport" and "None"

-->

<authentication mode="Windows" />



<!-- AUTHORIZATION

This section sets the authorization policies of the application. You can
allow or deny access

to application resources by user or role. Wildcards: "*" mean everyone, "?"
means anonymous

(unauthenticated) users.

-->

<authorization>

<allow users="*" /> <!-- Allow all users -->

<!-- <allow users="[comma separated list of users]"

roles="[comma separated list of roles]"/>

<deny users="[comma separated list of users]"

roles="[comma separated list of roles]"/>

-->

</authorization>

<!-- APPLICATION-LEVEL TRACE LOGGING

Application-level tracing enables trace log output for every page within an
application.

Set trace enabled="true" to enable application trace logging. If
pageOutput="true", the

trace information will be displayed at the bottom of each page. Otherwise,
you can view the

application trace log by browsing the "trace.axd" page from your web
application

root.

-->

<trace enabled="false" requestLimit="10" pageOutput="false"
traceMode="SortByTime" localOnly="true" />



<!-- SESSION STATE SETTINGS

By default ASP.NET uses cookies to identify which requests belong to a
particular session.

If cookies are not available, a session can be tracked by adding a session
identifier to the URL.

To disable cookies, set sessionState cookieless="true".

-->

<sessionState

mode="InProc"

stateConnectionString="tcpip=127.0.0.1:42424"

sqlConnectionString="data source=127.0.0.1;user id=sa;password="

cookieless="false"

timeout="20"

/>

<!-- GLOBALIZATION

This section sets the globalization settings of the application.

-->

<globalization requestEncoding="utf-8" responseEncoding="utf-8" />


</system.web>

</configuration>



*****************

Here is the error message that I receive from the server's screen:





Server Error in '/' Application.
----------------------------------------------------------------------------
----

Access denied to 'C:\WWW_TestSystem\'. Failed to start monitoring file
changes.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Access denied to
'I:\WWW_TestSystem\'. Failed to start monitoring file changes.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.


I already assign Change permission on IUSR account on that folder but still
error prompts.
 
J

Juan T. Llibre

You're receiving the error message,
so the <customErrors mode="Off" /> setting
is working as it should.

Now, for the error itself::
Access denied to 'C:\WWW_TestSystem\'.
Failed to start monitoring file changes.
Exception Details: System.Web.HttpException:
Access denied to 'I:\WWW_TestSystem\'.
Failed to start monitoring file changes.
I already assign Change permission on IUSR account
on that folder but still error prompts.

Try assigning Read and Change permissions to the
MachineName\ASPNET account, if you're using IIS 5.x,
or to the Network Service account, if you're using IIS 6.0.

Let us know how you do.



Juan T. Llibre
ASP.NET MVP
===========
 
D

DalePres

You can't deploy by Explorer alone without taking the additional step of
configuring the web application. This can be done in the IIS Manager or by
sharing the folder using the Web Sharing tab of the folder context menu in
explorer.

Alternatively, if you use FrontPage extensions to deploy your application,
FrontPage Extensions will configure the web application for you.

Hope this helps,

DalePres
MCAD, MCDBA, MCSE
 
A

A P

Its already Off but same error message. I've tried opening the page on the
server and I find different error message. Btw, here is my current WebConfig
File:

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

<configuration>


<system.web>

<!-- DYNAMIC DEBUG COMPILATION

Set compilation debug="true" to insert debugging symbols (.pdb information)

into the compiled page. Because this creates a larger file that executes

more slowly, you should set this value to true only when debugging and to

false at all other times. For more information, refer to the documentation
about

debugging ASP.NET files.

-->

<compilation defaultLanguage="vb" debug="true" />

<!-- CUSTOM ERROR MESSAGES

Set customErrors mode="On" or "RemoteOnly" to enable custom error messages,
"Off" to disable.

Add <error> tags for each of the errors you want to handle.

-->

<customErrors mode="Off" />

<!-- AUTHENTICATION

This section sets the authentication policies of the application. Possible
modes are "Windows",

"Forms", "Passport" and "None"

-->

<authentication mode="Windows" />



<!-- AUTHORIZATION

This section sets the authorization policies of the application. You can
allow or deny access

to application resources by user or role. Wildcards: "*" mean everyone, "?"
means anonymous

(unauthenticated) users.

-->

<authorization>

<allow users="*" /> <!-- Allow all users -->

<!-- <allow users="[comma separated list of users]"

roles="[comma separated list of roles]"/>

<deny users="[comma separated list of users]"

roles="[comma separated list of roles]"/>

-->

</authorization>

<!-- APPLICATION-LEVEL TRACE LOGGING

Application-level tracing enables trace log output for every page within an
application.

Set trace enabled="true" to enable application trace logging. If
pageOutput="true", the

trace information will be displayed at the bottom of each page. Otherwise,
you can view the

application trace log by browsing the "trace.axd" page from your web
application

root.

-->

<trace enabled="false" requestLimit="10" pageOutput="false"
traceMode="SortByTime" localOnly="true" />



<!-- SESSION STATE SETTINGS

By default ASP.NET uses cookies to identify which requests belong to a
particular session.

If cookies are not available, a session can be tracked by adding a session
identifier to the URL.

To disable cookies, set sessionState cookieless="true".

-->

<sessionState

mode="InProc"

stateConnectionString="tcpip=127.0.0.1:42424"

sqlConnectionString="data source=127.0.0.1;user id=sa;password="

cookieless="false"

timeout="20"

/>

<!-- GLOBALIZATION

This section sets the globalization settings of the application.

-->

<globalization requestEncoding="utf-8" responseEncoding="utf-8" />


</system.web>

</configuration>



*****************

Here is the error message that I receive from the server's screen:





Server Error in '/' Application.
----------------------------------------------------------------------------
----

Access denied to 'C:\WWW_TestSystem\'. Failed to start monitoring file
changes.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Access denied to
'I:\WWW_TestSystem\'. Failed to start monitoring file changes.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.


I already assign Change permission on IUSR account on that folder but still
error prompts.
 
J

Juan T. Llibre

re:
I already assign Change permission on IUSR account
on that folder but still error prompts.

You may have missed this part of the reply
to this message which you have reposted :
 
A

A P

My server is a DC. It doesnt have local groups.


Juan T. Llibre said:
re:

You may have missed this part of the reply
to this message which you have reposted :
 
J

Juan T. Llibre

re:
My server is a DC. It doesnt have local groups.

Bad news.
Running ASP.NET on DC's is not a good idea.

See
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetch08.asp

Domain controllers and the ASP.NET process account

In general, it is not advisable to run your Web server on
a domain controller, because a compromise of the server
is a compromise of the domain.

See
http://msdn.microsoft.com/library/d...s/wss/wss/_exch2k_running_asp_net_on_a_dc.asp
for a run-down on how to setup a weak account
to run ASPNET under, so that you can run a more
secure IIS server on your domain controller.

Even though it says that it's for ASP.NET v1,
the same procedure will work for 1.1 or 2.0.
 

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

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top