Join David Gassner for an in-depth discussion in this video Understanding the development web server, part of ASP.NET Essential Training.
When you run a page from within Visual Web Developer, you're actually requesting it from a web server. You're using something called the Development Web Server, a bit of software that's included with both Visual Web Developer and Visual Studio that allows you to test your ASP.NET pages without having to install and configure the full Internet Information Services enterprise-level web server. When you create your first website and your first ASP.NET page and then go to the Debug menu and select Start Without Debugging, you'll see that you're opening the page in your selected web browser. I'm using Internet Explorer. If you look at the URL or the address of the page as it's requested from the web server, you'll see that the URL starts with http://localhost. localhost is the automatic name of a web server that's on your local system. You'll then see this bit of code, colon and then a numeric value. The numeric value is something called a port number. When you run a web page on the internet, typically, you're requesting that web page from port number 80, known as the default HTTP port. Or if you're requesting a page using a prefix of HTTPS, which stands for secure, you're typically using the port in the background of 443. When you use the Development Web Server, by default, the web server assigns a dynamic port number, that is it makes it up at the moment that you start the server. And you can see what the dynamic port number is by looking at the web browser, but you can also see it by going down to the system tray in the lower right-hand corner of the Windows interface. There you'll see a systems tray icon, and if you move the cursor over that icon, you'll once again see an indication of the development server's port number. In most cases, it's fine to use that dynamic port, but in some cases, you might want to set the port explicitly, so you know which port number you'll be using. I'll show you how to do that here. In order to freeze the port number for a particular website, start off in the Properties view. I've gone to the Properties view, which is down in the Lower-right corner, and I'm going to double-click its title bar. That causes it to float. I'll then move it out into the center of the screen and then click and drag to make it a little bit wider. Next, I'll go back to the Solution Explorer, which is still docked on the right, and I'll click on the folder name--that is, the folder which is the name of the website, in this case Hello World. The Properties panel updates and shows the web server properties. Notice that by default, a property called Always Start When Debugging is set to True, and a property called Use Dynamic Ports is set to True as well. I'm going to change that value from True to False, and then I should be able to click into the Port number property. It takes just a moment for it to be activated, so be patient. And then you can type in any port number that isn't otherwise being used on your system. Now, when you set your own port number, you should always use a value that's in the thousands or up. And there's no way to know exactly which port numbers are used on your particular system, but typically, if you use something in the 4,000 range you'll be safe. So I'm going to use a value of 4444. Now, I'm going to save my changes by pressing Ctrl+S. I'll go down to the system tray and I'm going to right-click on the icon for the ASP.NET Development Server, and I'll select Stop, which closes down the web server. Now, I'll move the Properties panel over so I can see the toolbar, and once again, I'll select Debug > Start Without Debugging. The web server is once again started up automatically, but now I'm using the port number 4444. I'll see the value in the web browser and I'll also see it in the system tray icon for the development server. So once again, the purpose of the Development Web Server is to allow you test your pages using a full-blown web server, but without having to go through the process of installing and configuring the full enterprise web server, Internet Information Services. When you deploy your ASP.NET website for production--that is, for use by your users--you'll want to use the full web server. IIS has a lot of tools that the Development Web Server doesn't have, and it's really scalable, meaning it can support a lot more users at the same time than the development server can. But for convenience, you can't beat the Development Server during your initial development phase.
- Storing data with SQL Server
- Using the GridView control to present and edit dynamic data
- Creating a data entry system
- Attaching external CSS files
- Creating pages to log in and authenticate visitors
- Installing Internet Information Services (IIS) on Windows XP and Windows Vista
- Deploying an ASP.NET website on IIS
Skill Level Beginner
Q: When trying to create a new database, after pasting the text into the SQL Management Suite and executing the query, the database is not created and the following message appears:
Database 'mybookstore' does not exist. Make sure that the name is entered correctly.
What is causing this error?
A: The database must be explicitly created before the script is run. Start by right-clicking on the Databases item in the left panel, then follow the prompts to create the database. Then retry the query.
Q: I am running into problems installing the latest version of ASP.NET. Has the installation procedure changed since this tutorial was recorded?
A: The installation process for the newest version of ASP.NET and its associated tools is a little different than in ASP.NET 3.5, which was used to record this course. You can download Microsoft Web Platform Installer 2.0 from:
<a href="http://www.microsoft.com/web/downloads/platform.aspx" target="blank">http://www.microsoft.com/web/downloads/platform.aspx</a>
Microsoft Web Platform Installer 2.0 includes everything you need:
Visual Web Developer 2010?
SQL Server Express
You must have one of the following operating systems:
Windows Vista SP1?
Windows XP SP2+?
Windows Server 2003 SP1+?
Windows Server 2008?
Windows Server 2008 R2
You must have administrator privileges on your computer to run the Web Platform Installer.
Q: This course was updated on 2/13/2013. What changed?
A: Since this course was recorded, Microsoft has released both ASP.NET 4.5, the latest version of the server-side web application server, and Visual Studio Express 2012 for Web (the successor product to Visual Web Developer). Both have been adapted to work on Windows 8. There will be some visual changes and some functional changes, but most of the server-side code shown in the course is the same. This update provides a map for those working with the latest software so they can navigate their way through the course.
In particular, we added <em>What's new</em> movies for both ASP.NET 4 and 4.5, a movie explaining the significance of the update, a movie on installing SQL Server Express 2012, and one on exporting database scripts in SQL Server Management Studio 2012, as well as updates to visuals throughout the course.
Q: In the chapter on user authentication, an authentication error results when I try to use the Login component or register a new user. How do I fix this?
A: This is a known error that can occur when using the original release of Visual Studio 2012 Express for Web. Update your copy of Visual Studio for Web to at least maintenance release 1, and then try the exercise again.