Setting up a web application locally with WXP_SP2, IIS 5.1, ASP.NET 2.0 and SQL Server 2005 Express

I founded this mini howto I wrote a few years back lost at Penyaskito# blog. I think it is time to publish at its right place.

I’ve been building a little Web Application in ASP.NET 2.0 which uses a local database file in the App_Data directory. It works fine in the ASP.NET server… but when I tried to use it in the IIS 5.1 it doesn’t. Now, we will take the following steps in order to make it work.

In first place, I published the Web Site, Go to Build menu and choose Publish Web Site instead of Build Web Site. Next, we will publish it in a folder we’ve created previously. If it founds an old version of our site, it prompts you so as to delete all old files. Choose Ok to proceed.

Once you have your Web Site published, you will find that App_Code folder has disappeared. Don’t worry, classes have been compiled so there’s no need of the sources (You will find a special file in the bin folder with the assemblies).

After that, you must right-click the root folder of our web application a choose Web Sharing tab from the Properties window. Select Share this folder and then click Add. A new window appears. In the Alias field, type the name of the Virtual Name of the application. If you write Yadayada, your application will be found at: http://localhost/yadayada. In Access Permissions, you have to let it Read and Write (of course, otherwise you couldn’t update your database), in the Application Permissions one, choose Execute (because Scripts are ASP, not ASP.NET (this is a common mistake)). Click Ok and close the window.

Later, open the IIS Management Console (Control Panel > Administrative Tools > Internet Information Services). Extends the Default Web Site node: you should see an item with the alias you chose before (yadayada). Right-click it and choose Properties. Then, go to the Directory Security tab and find the Edit button in the Anonymous Access and Authentication Control frame. Check the Anonymous Access and click Browse, in the new window, write “ASPNET” and click Ok. In this way, any user can use our web application and localhost\ASPNET user account. Now, apply the new configuration.

Finally, we must give the ASP.NET user account permission to write in the folder of the web application. Right-click the root folder of our web application a choose Security tab from the Properties window. If this tab doesn’t appear, you will have to do some changes in your windows configuration. Don’t panic, it’s so easy. In a windows explorer window go to Tools menu, open Folder Options, choose View tab, Uncheck the last option in the Advanced Settings: Use simple file sharing. Apply the new configuration and next time you choose the properties windows from the explorer, you will see a Security Tab.

Okay, you’re got it. You’ll see the Advance button in the bottom of the page. Click it and a new window appears. Just click Add in the new window. And write down ASPNET and click okay. It’s the same kind of window you see before. It adds the local machine aspnet account. Now, you have to choose what permissions this account will have: click Full Control if you’re sure that any of your applications on that folder cannot damage the system. Apply this configuration and try out your web application.

Now, it should works.

Advertisement

About me


My name is Rafa Vargas. I'm an undergraduate student of Computer Science at University of Seville, Spain. I am mainly interested in computer security, usability and the business of software.

Click here to read the full story.

Twitter subscription

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 6 other followers

Archives


Follow

Get every new post delivered to your Inbox.