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

  • Organizations across the world continue to strive for greater agility, efficiency, and innovation. But they also need to cut costs, improve productivity and become more competitive. These new requirements create complexity and extra tasks for IT to manage. But with greater complexity, it is easy to miss a minor system vulnerability, which in turn can cause major security issues. This white paper analyzes how complexity in the IT environment is causing new security challenges and how best to address this …

  • The proliferation of cloud computing options has begun to change the way storage is thought about, procured, and used. IT managers and departments need to think through how cloud options might fit into and complement their onsite data infrastructures. This white paper explains cloud storage and backup, providing advice about the tools and best practices for its implementation and use. Read this white paper for some useful takeaways about how to take advantage of cloud storage for high availability, backup and …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds