views:

1910

answers:

1

I am using VS 2008, SQL Server 2008, IIS 6.0 Manager on an XP OS. I developed my very first C# project in VS 2008 and it runs correctly in VS. But now I need to publish this project on my website. This project also involves an SQL Server 2008 Adventureworks database on this same computer.

I will use this same computer to host the website and house this database. I know HTML but not how to add a .NET project to a web site, especially one that also uses SQL Server. Can u offer me tips as to how to proceed? This is not a Windows Form Application, so I am pretty sure it is a Web Application.

I started by right-clicking the project and selecting "Convert to Web Application" and then I selected the URL for my site. But then when I went to this URL, it still shows the original image.

Then I opened IIS6 Manager, Default Web Site, and I added a new virtual directory. I typed an alias and pointed the path to the folder containing my web application (this folder has a bin, App_Data, obj, and Properties folder in it. It also contains all of the .CS files).

Next I reviewed the MS documentation at

http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/fc473b0b-162b-4146-932c-2a9a50c52ecb.mspx?mfr=true.

But this didn't help much. All I learned from this documentation was to copy the DLL to the C:\Inetpub\wwwroot[MyApp]\bin directory. Also I copied the web.config, global.asax, and default.aspx files to the C:\Inetpub\wwwroot[MyApp] directory. And then I changed the App's Properties via the IIS6 Manager as follows: Virtual Directory tab I selected new Local Path pointing to C:\Inetpub\wwwroot\AFS\bin directory instead of the native VS project directory (C:\Documents and Settings\New Owner\My Documents\Visual Studio 2008\Projects\AddFileToSQL\AddFileToSQL).

The only difference between these two directories I see is that the name of my application in VS and folders is "AddFileToSQL", but name I gave this folder under C:\Inetpub\wwwroot\ was "AFS". Does this matter?

When I navigate to my website, 192.168.2.2, it still shows me the default web page. However when I go to http://192.168.2.2/AddFileToSQL, it prompts me to enter password. Which password and is this right? And is this the correct URL to enter?

There are so many tabs and options in this IIS Properties window that I'm not sure if I configured it properly. I also see many Property options in VS 2008 for this project. Right now everything in these two Properties windows is set to default. Do I need to make any changes to any of these properties?

Yes I know I have XP. Target and development server are the same. This XP is the only machine I have. Are u sure IIS 6 only works with Server 2003? Cause I know that I'm able to configure the IIS6 Manager.

I'm not sure if it is Cassini or not, but from VS when I run this application, it does open a web browser and does what I want it to. I ran the aspnet_regiis command u suggested. It looks like maybe that was not installed cause it took a few minutes to install.

Now which URL should I go to to test this app? I opened the Properties window and it said Virtual Directory Local Path is C:\Inetpub\wwwroot\AFS\bin. Next I right-clicked this app from IIS6 Manager and chose "Browse". But this caused it to produce output: "The website declined to show this webpage". I feel like I am very close to the solution, but still not there yet. Do u have other suggestions?

A: 

The easiest way to deploy a web app is to use Publish by right clicking on the web app and selecting "Publish", you can specify either an HTTP path or a fully qualified drive path or a fileshare locaton for this.

Typically the username/password prompt will be displayed when you have Integrated Windows authentication enabled and anonymous disabled, I believe that if your windows user is part of a domain, your NT credentials should flow through the browser(typically it does in IE) , if you are hitting the site using a Mozilla based browser such as Firefox you may have to enter your credentials.

Also, if you are not using SQL authentication(UserID/Password in Web.config) then you would need to grant access to the account under whose identity your web site is running under(by default(on XP) web apps run under Network Service)

Hope this helps.

Abhijeet Patel
Still not working for me. I entered http://192.168.2.2/AFS/Default.aspx and it returned the error: The XML page cannot be displayed...A name was started with an invalid character. Error processing resource 'file:///C:/Inetpub/wwwroot/AFS/Default.aspx'. Lin...<%@ Page Language="C#" AutoEventWireup="true"...And this was after I reviewed the link: http://msdn.microsoft.com/en-us/library/ms998297.aspx.From this URL I added a new custom user account to use ASP.NET permissions but this link was for Server 2003 and I have XP so step 4 wasn't same. What else can I do?
salvationishere
Are you deploying to a Windows Server 2003 system or on XP. Your original question mentions XP with IIS 6.0, IIS 6 is only available on Windows Server 2003.Are you able to view the page from the built in Visual studio Web browser(Cassini) when developing?
Abhijeet Patel
Can you ensure that the target server has .NET installed on it.Also open up a command prompt, and navigate to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727and run the following to ensure aspnet is registered with IIS: aspnet_regiis.exe –i
Abhijeet Patel
Abhijeet, please see newly edited version above.
salvationishere
To the best of my knowledge IIS6 is not available on XP,you can verify this by going to the IIS management console and check the version number in Help->About IIS....If your OS is XP it should say 5.1Also,instead of right clicking the app and choosing browse can you instead select the virtual directory in IIS from the left hand pane and then select an aspx page from the right hand hand pane in IIS,right click on the page and select browse?Conversely, you can also try to hit the web page directly in IIS using a browser,your URL should look something like http://localhost/AFS/Default.aspx
Abhijeet Patel