Where to Put Files with an ASP.NET Host!

Environment: ASP.NET

If you're developing your ASP.NET Web application on the server you intend to run it on, you'll find deployment a real doddle: Just hand out the address. Don't worry about the security of your source code: IIS will automatically prevent anyone from downloading it. And when it comes to administration? Simply open the project straight from the Web server and start changing. Super-cool!

However, if you're exposing your ASP.NET Web application through a host account, it's most likely that you'll be given just one "virtual folder," a single application within IIS. That's great if you're just uploading one core application—you merely have to access your folder via FTP, transfer all your application files, access through your URL, and, hey presto!

More likely, however, is that a developer will have multiple ASP.NET Web applications to upload—a root application, for example, and a separate project he wants to place in an "admin" subdirectory. If you do a direct upload from here, the separate admin project will simply not work: its assembly (the DLL file in the Bin folder) is in the wrong location. Try it and you'll see. There are other considerations, too, such as the location of Global.asax.

So, if you're uploading multiple ASP.NET Web applications, follow this three-point checklist for trouble-free deployment:

  1. Create a Bin directory via FTP in your root application folder. Go through every Web application you plan to upload and move its contents (typically your assembly DLL, any referenced components, and a possible debug file) into this one directory.
  2. You're allowed only one Web.config and Global.asax file per IIS application. Choose the files you want to use and upload them directly into your root folder. Make sure you do not upload a Web.config file into any other directory; it'll cause an error in that directory, whereas excess Global.asax files simply get ignored.
  3. Finally, upload the rest of your files (typically just ASPX pages) into the relevant locations and subdirectories, and then attempt to access them via your URL. They'll all automatically find their supporting assemblies in the root Bin folder, plus use the Web.config and Global.asax files you uploaded.

It's always confusing at first, but follow these three steps to take real advantage of your hosting account and save yourself a good few bucks. Good luck!

About the Author

Karl Moore (MCSD, MVP) is an experience author living in Yorkshire, England. He is author of numerous technology books, including the new Ultimate VB .NET and ASP.NET Code Book, plus regularly features at industry conferences and on BBC radio. Moore also runs his own creative consultancy, White Cliff Computing Ltd. Visit his official Web site at www.karlmoore.com.



About the Author

Karl Moore

Karl Moore (MCSD, MVP) is an experience author living in Yorkshire, England. He is the author of numerous technology books, including the new Ultimate VB .NET and ASP.NET Code Book (ISBN 1-59059-106-2), plus regularly features at industry conferences and on BBC radio. Moore also runs his own creative consultancy, White Cliff Computing Ltd. Visit his official Web site at www.karlmoore.com.

Comments

  • There are no comments yet. Be the first to comment!

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: December 11, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT Market pressures to move more quickly and develop innovative applications are forcing organizations to rethink how they develop and release applications. The combination of public clouds and physical back-end infrastructures are a means to get applications out faster. However, these hybrid solutions complicate DevOps adoption, with application delivery pipelines that span across complex hybrid cloud and non-cloud environments. Check out this …

  • Due to internal controls and regulations, the amount of long term archival data is increasing every year. Since magnetic tape does not need to be periodically operated or connected to a power source, there will be no data loss because of performance degradation due to the drive actuator. Read this white paper to learn about a series of tests that determined magnetic tape is a reliable long-term storage solution for up to 30 years.

Most Popular Programming Stories

More for Developers

RSS Feeds