Publishing My Website II

J

Jonathan Wood

Okay, so forget about precompiling for now. I'll just FTP the files to my
site as this seems it will be trouble enough.

So, I see my web.config file has grown to well over 100 lines since
upgrading to VS2008. Now I need a web.config file for my site. I took the
existing one and changed the connection strings. Of course, it doesn't work
now. The error that appears is pasted below my signature.

My question is, how are we supposed to be dealing with this? Is it just
assumed that we will know what each and every line means that VS put there
and we'll know which lines to change, remove, and keep. Or is there actually
some sort of other method that can be used so my project will actually work?

Thanks.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

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>
 
J

Jonathan Wood

Actually, by working through a few things, the thing actually started
working, which is cool.

But I'm still curious as to what all those config settings are for and if I
should be deleting some of them.

Thanks.
 
C

Coskun SUNALI [MVP]

Actually, by working through a few things, the thing actually started
working, which is cool.

Glad that it works.

Just to tell what that error was... The error that you see is a common
error avoiding your visitors to see the complete and detailed exception.
But I'm still curious as to what all those config settings are for and
if I should be deleting some of them.



To see the complete and detailed exception, you either have to log it
somewhere and then watch the log file/database/event logger or you have to
set "customErrors" attribute to "off" as described within the error that
you see.

Other than that, web.config file is a special file which means a lot for
ASP.NET. There are some other files like app.config (for Desktop
applications and class libraries) and machine.config which I will not
describe within the context of this post.

Using web.config, you can set most of the properties of your web
site/application. You can even create custom sections and set their
properties in web.config file. So, if VS adds something to that file, let
them stay there, though sometimes VS might add unnecessary configuration
and if you know what they really mean, you can remove them. For example,
if you will not use Microsoft Ajax in your web application, you will not
most probably need the configuration of Microsoft Ajax in your web.config
file.

If you still think that there is a lot of information in that file and you
just want to see your connection strings clearly, please refer to one of
my posts describing how to achieve that:
http://sunali.com/2008/01/23/configsource-property-dividing-configuration-files-into-pieces/

All the best,
Coskun SUNALI
Microsoft MVP
http://sunali.com
http://propeople.dk
 

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,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top