How can I solve this problem::Server Error in '/' Application


#1

How can I solve this error. When I run application developed in ASP.net (C Sharp) from Visual studio.net 2005 the application is running on http://localhost:1057 without any problem. But when I run the same application on using Internet Information Server(IIS) 5.1 on http://localhost:9090 it is giving me an error. I have registered ASP.net to IIS, but I am still receiving the same problem. Your help will be highly appreciated.

Error I am receiving
[B]Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

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 27: ASP.NET to identify an incoming user.
Line 28: -->
Line 29: <authentication mode="Windows"/>
Line 30: <!--
Line 31: The <customErrors> section enables configuration

Source File: c:\inetpub\wwwroot\oracle\web.config Line: 29

Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

[/B]

Example of code( ASP.Net ) I am running is as follows;

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Oracle Database Connection</title>
</head>
<body>
    <form id="form1" runat="server">
    <div style="text-align: center">
        <strong><span style="font-size: 16pt">Oracle Database Connection</span></strong><br />
        <br />

    </div>
        <table>
            <tr>
                <td style="width: 166px" valign="top">
                    <asp:Label ID="Label1" runat="server" Text="Username" Width="135px"></asp:Label></td>
                <td style="width: 286px" valign="top">
                    <asp:TextBox ID="Textusername" runat="server"></asp:TextBox></td>
                <td style="width: 315px" valign="top">
                </td>
            </tr>
            <tr>
                <td style="width: 166px" valign="top">
                    <asp:Label ID="Label2" runat="server" Text="Password" Width="133px"></asp:Label></td>
                <td style="width: 286px" valign="top">
                    <asp:TextBox ID="TextPass" runat="server" EnableViewState="False" OnTextChanged="TextPass_TextChanged"></asp:TextBox></td>
                <td style="width: 315px" valign="top">
                </td>
            </tr>
            <tr>
                <td style="width: 166px; height: 21px" valign="top">
                </td>
                <td style="width: 286px; height: 21px" valign="top">
                    <asp:Button ID="Button1" runat="server" Text="Add" /></td>
                <td style="width: 315px; height: 21px" valign="top">
                </td>
            </tr>
        </table>
        <br />
        <br />
        <br />
        &nbsp;<br />
        <br />
    </form>
</body>
</html>


#2

Morning,

I think your only problem is exactly what the error message says.

This error can be caused by a virtual directory not being configured as an application in IIS.

So go to Control Panel -> Administrative Tools - > Internet Information Services
When it opens up, expand the web sites, pick the one you're working on, right click->properties-> and there at the Application Settings press the 'create' button.
That should help.
Also, since your application is under the c:\inetpub\wwwroot\oracle\ folder it's not enough to type in http://localhost only. (and leave the port)


#3

I have setup virtual directory on IIS but I am still receiving the same error?. I
am typing htt://localhost:9090/oracle/defual.aspx. But still receiving the same. So how can I solve this problem???


#4

What snomag said.

The problem seems to be that the root folder is configured as an application; the directory where your application resides is not. This causes IIS to consider your application merely a sub-directory. While web.config files can reside in subdirectories, certain sections are not allowed at directory level.

Make certain the the directory where the web.config resides is configured as an application. Do it like snomag outlined.


#5

How can I do it? I have tried to what snomag outlined, but it is not helping?
Please explain more on web.config? What should I do on web.config??


#6

Nothing.

Check again if you've created the appliction and if the correct version of ASP.NET is set under the ASP.NET tab.
And again, you really don't need the port, so go with http://localhost/oracle/defual.aspx and you should be fine.


#7