Web forms

G

Gus Chuch

I’m trying to do a web form in C#, it’s an example in a Deitel book all it
does is display the current time of the web server. I see the files in my
FTP:// website that visual studio created but when I run or debug (F5) I get
this error message.

Error 1 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.

C:\Documents and Settings\Administrator\Local
Settings\Temp\VWDWebCache\guschuch.infinites.net\WebTime\Web.Config

Do I need to down load some kind of an internet information services (IIS)?
Or is there more to this?
And on my web page I get an 403 FORBIDEN PAGE The web page you are trying
to access has been removed by our server administrator.
We do not allow porn pages (anything with complete nudity) or any illegal
pages!
Any ideas?
 
M

Marc Gravell

First - what version of Visual Studio and .NET are you using?

How are you hosting the application? By default, when debugging (F5)
Visual Studio uses the Cassini web-server on the developer's desktop,
which should (normally) configure itself fine. You can, however,
change it in the solution/project properties to attach to existing
servers such as IIS[*].

The problem here is probably as described by the message you posted:
"This error can be caused by a virtual directory not being configured
as an application in IIS."

Basically, if you are hosting the app in IIS, you need to tell it to
treat the project as a new application (and tell it what version of
ASP.NET to use). How (exactly) to do this depends on what version of
IIS you are using (assuming you are hosting in IIS), but basically
hangs off the properties page for the folder.

[*]=aside: if you are debugging in IIS, you need to be careful to set
the paths correctly - i.e. so IIS is looking at your project output
and VS knows the exact IIS path - otherwise things get very, very
confused.

Marc
 
P

Peter Bromberg [C# MVP]

When you say "I can see the files in my FTP:// web site" this may be the
issue. I doubt the you can debug / run a remote website that's deployed via
FTP from Visual Studio. FTP is simply a convenient way to get your app over
to the production web server. Run it locally from IIS - this is the closest
you can come to what will happen in production.
-- Peter
http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http://www.blogmetafinder.com
 

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

Top