Web.config error

samflex
11-29-2006, 08:06 AM
Greetings to all (again)

I had just completed testing a small asp.net project I completed on my local machine. Everything works fine.

But when I deployed to a web hosting company and tried to test it, I get this 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>

I consulted with the web hosting company about the error and below is their explanation:

This error from your code

web.config Line 25

Line 23: "Forms", "Passport" and "None"
Line 24: -->
Line 25: <authentication mode="Windows" />
Line 26:
Line 27: <!-- AUTHORIZATION


Source File: D:\W3Sites\Samflex\www\budget\web.config Line: 25



Show Additional Configuration Errors:


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. (D:\W3Sites\Samflex\www\budget\web.config line 57)

Can someone please explaint to me how to fix this?

I am still pretty much a complete newbie on asp.net

Thanks very much

wayneph
11-29-2006, 08:18 AM
You're using Windows Authentication with a Web Hosting company? I don't know of any cases where that would work...

But I don't see anything wrong with your config file. Many Hosting companies have control panels that you can log into to manage the IIS configuration side of things. In order to use a web.config file the directory containing it needs to be configured to run as an application. You should be able to configure that from the hosting control panel.

Unfortunately every host's panel is a little different, so I can't say exactly how to do it. If you can't find it in your options, the best thing to do is have their support people help you do it.

(To find errors in the future, you can change the config file's error settings to display the errors. Obviously when you're don't testing, I'd set it up to suppress them again, but they are really handy during debugging.)

samflex
11-29-2006, 08:33 AM
Thanks, as always, Wayne for your prompt response.

samflex
11-29-2006, 08:40 AM
I forgot to ask you.

If I can't use this:

<authentication mode="Windows" />

There are 2 other options, "forms" and "None"

Should I use any of them?

Unfortunately, this hosting company doesn't have a control panel.

Also, there is a way to create a dll for all the code-behinds.

Will this solve that problem?

If yes, do you know of a step-by-step process of converting the codes to dll?

wayneph
11-29-2006, 12:25 PM
using codebehind dlls, has nothing to do with this. If you're using Visual Studio, then creating the .dll is as easy as compiling your app. If you're not then, you'll need to use the SDK, and (un)fortunately I've never had to do it. At one point I saw an article on how to do it, but it's been a long time and I have no idea where it is.

The <authentication> node really needs to be set based on what your application needs. If this is a public site and everyone has access to every page, then just use the "None" option. If you're going to have parts of your site that are only available to specific users, I'd use "Forms". But in order for Forms Authentication to be usefull, you'll also need to use the <authorization> section of your web.config and possibly set up multiple location nodes if different areas have different permissions. In short, there isn't a short answer. It depends on what you need.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum