Lisa Wollin

Deploying ASP.NET Applications

We recently published an article in the MSDN FrontPage portal called Using ASP.NET with FrontPage.  The article does well, but there's one complaint from a reader that the article doesn't address how to make an ASP.NET project run on a Web server.  I'm not sure the article should, but I remember having that same question with the first ASP.NET app I actually copied to a server.  It wouldn't run, and there were no clues as to what I needed to do to make it run.  I even tried creating a Web app directly on the server to see if that would help.  It didn't.

I was certain it was a server problem and not a code problem, since I could run the application fine on my machine just not on the server.  The .NET Framework was, of course, installed and running. So I did some research and what I found was a help topic that said that ASP.NET deployment is as simple as copying the necessary files to the Web server.  Okay, I did that without success, so what was I missing?

When I was in college, I had a writing instructor who used the term COIK writing:  Clear Only If Known.  Many technical writers mistakenly make assumptions about their readers.  Now I'm not saying that all assumptions are bad or wrong.  For example, as a programmer writer, I have to assume that my readers at least know what code is if they haven't actually written it before.  But there are just some assumptions that shouldn't be made.

With the help for deploying ASP.NET applications, the assumption was that I understood what needed to be done on the server in order to make my Web app run, making the additional information unnecessary.  Perhaps I should have known; I've certainly worked with IIS, but (as I've said before) servers are not my thing.  In the past, I've preferred to leave them to others, but I've realized that if I want to provide server-side anything on my Web sites, I need to know as much as, if not more than, my Web server admins about what the server needs to do and how to do it.

The help for deploying ASP.NET applications wasn't incorrect.  You can, in fact, copy ASP.NET files to the server using XCopy or an FTP program, provided you know which files you need to copy.  However, deploying a Web app is more than just copying the necessary files to the Web server.  So what else needs to be done?

In the IIS Properties pages for a Web site's virtual directory, there is a Directory tab that contains the application settings.  By default, when an admin creates an IIS Web site (or virtual directory), the application name is empty or says "Default Application" in greyed text.  All you need to do is click Create to tell IIS to run server-side code from the Web sites virtual directory.

The folder into which you copy or FTP the files for an ASP.NET Web application may be a subfolder in your Web site but may not be a virtual directory in IIS.  In this case, your Web server admin needs to add it as a virtual directory in IIS.  Either way, the admin also needs to set the application settings for the virtual directory.

Of course, this is a simplified version of what needs to be done, and I'm sure there are other settings that Web developers may need to know to effectively deploy ASP.NET applications, but every Web app that I created before knowing this, that previously didn't work, now functions as expected after clicking Create.  Isn't it wonderful when things work?

Published Wednesday, May 19, 2004 5:22 PM by lisawoll
Filed under: ,
Anonymous comments are disabled

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker