Solved

Classic ASP site under IIS 7.  Is web.config file needed, and how to create it

Posted on 2008-06-13
5
2,311 Views
Last Modified: 2012-05-05
I maintain a classic ASP application.  I recently installed IIS 7 on my Vista Ultimate system.  I added my website to the configuration, and granted IUSR appropriate access in the file system.

Attempting to browse the site, via http://localhost:80 results in a server error, complaining that the related configuration data for the page is invalid.  Further in the page, I see:
------------------------------------------------------------
Config Error: Cannot read configuration file
Config File: \\?\C:\Users\....my path....\My_Website\web.config
Config Source:
   -1:
    0:
More Information... This error occurs when there is a problem reading the configuration file for the Web server or Web application. In some cases, the event logs may contain more information about what caused this error.
------------------------------------------------------------

Fair enough.  It's looking for a web.config file, and one doesn't exist.  Classic ASP doesn't use them, I'm not developing with Visual Studio, and I have no idea how to bring into existence a usefully populated web.config file.  

If you answer, 500 points are yours.  Thanks.
0
Comment
Question by:JohnAtkinson
  • 3
  • 2
5 Comments
 
LVL 37

Expert Comment

by:samtran0331
ID: 21796452
As you've already posted, Classic ASP doesn't need or use a web.config file.
the problem here it looks like is that you have the default web site in IIS7 configured as an ASP.Net application...
First of all be sure Classic ASP is enabled in your IIS.
http://goingspare.wordpress.com/2007/07/24/classic-asp-on-vistaiis-70/
(notice the first screenshot)...

There are a few links at the end of that article that might help too.

...are you tring to run Classic ASP and ASP.Net as 2 separate applications?
or is your intention to have *.asp and *.aspx pages in the same "application"?
0
 

Author Comment

by:JohnAtkinson
ID: 21797130
This application will remain Classic ASP for the forseeable future.
0
 

Author Comment

by:JohnAtkinson
ID: 21797145
oh, and classic ASP is turned on.  I turned on everything when I enabled IIS 7.
0
 
LVL 37

Accepted Solution

by:
samtran0331 earned 500 total points
ID: 21797304
>>Attempting to browse the site, via http://localhost:80 results in a server error
I would imagine that the root site (at localhost port 80) is configured to be ASP.Net.
I've never changed it in Vista/IIS7 to *not* be ASP.Net...
I'm curious as to what happens if you just put in a default web.config....
try creating a new file in notepad named "web.config" and put the below in it ..(and of course save it to the correct directory)
<?xml version="1.0"?>

<configuration>

    <appSettings/>

    <connectionStrings>

    </connectionStrings>

    <system.web>

        <compilation debug="false" strict="false" explicit="true" />

        <pages>

            <namespaces>

                <clear />

                <add namespace="System" />

                <add namespace="System.Collections" />

                <add namespace="System.Collections.Specialized" />

                <add namespace="System.Configuration" />

                <add namespace="System.Text" />

                <add namespace="System.Text.RegularExpressions" />

                <add namespace="System.Web" />

                <add namespace="System.Web.Caching" />

                <add namespace="System.Web.SessionState" />

                <add namespace="System.Web.Security" />

                <add namespace="System.Web.Profile" />

                <add namespace="System.Web.UI" />

                <add namespace="System.Web.UI.WebControls" />

                <add namespace="System.Web.UI.WebControls.WebParts" />

                <add namespace="System.Web.UI.HtmlControls" />

            </namespaces>

        </pages>

         <authentication mode="None" />

        <!--

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">

            <error statusCode="403" redirect="NoAccess.htm" />

            <error statusCode="404" redirect="FileNotFound.htm" />

        </customErrors>

        -->

    </system.web>

</configuration>

Open in new window

0
 

Author Closing Comment

by:JohnAtkinson
ID: 31467138
After adding a web.config file, the error message changed.  I discovered that I had grant TWO groups, IIS_IUSRS and IUSRS, read, read & execute, and list permissions.  I was accustomed to granting it for IIS_IUSRS, but not IUSRS.  Must be a new "feature" of IIS7.

Now if I could just get php to install properly...
But that's another question!
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now