tags:

views:

203

answers:

3

Ok, this has got to be a super simple problem. I just can't seem to find the answer anywhere. First - I'm not a web developer of any kind, I'm an old school c programmer - so don't flame me for what's probably something quite trivial :)

I need to write a small proof-of-concept web app using ASP.NET. My first attempt here is to create a "Hello World!" app. So I opened up Visual Studio, and made a new web application. I have my Default.aspx file that calls a C# function that is inside the helloworld.dll created automatically by Visual Studio.

I installed IIS on my local machine and created a virtual directory in the wwwroot subdirectory. I put the Default.aspx and helloworld.dll in that directory. Now when I browse to that page I see the following.

Server Error in '/test' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load type 'HelloWorld._Default'.

Source Error:

Line 1:  <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="HelloWorld._Default" %>
Line 2:  
Line 3:  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;


Source File: /test/default.aspx    Line: 1

Obviously, IIS doesn't know where to look for the .dll or anything like that. I just don't know how to register the .dll with IIS (or whoever manages that stuff in .net) so that it can find the functions it need.

Can someone let me know how to "install" an ASP.NET application on IIS?

+4  A: 

Your best bet is to use 'Publish website' from the Visual Studio Solution Explorer.

Chris Lively adds:

Just a minor add: Publish Website can be found by Right Clicking on the project name. The command will be named "Publish..."

Geoffrey Chetwood
Just a minor add: Publish Website can be found by Right Clicking on the project name. The command will be named "Publish..."
Chris Lively
+1  A: 

I would recommend the solution of Rich B. And something else... DLLs are in a folder called "bin". Not at the root of the folder.

Maxim
upvote for the /bin remark.
Joel Coehoorn
+2  A: 

You do not need to move the files to the wwwroot directory manually. A virtual directory in IIS points to any folder in the file system to look for the appliction.

Follow these steps if you are using IIS6:

  1. Open IIS
  2. Under "Web Sites", right-click "Default Web Site"
  3. Select "New"
  4. Select "Virtual Directory"
  5. Type in a name for your new app.
  6. Select the path of your application. By default this is usually something like C:\Your Documents\Visual Stuido 2008\Projects\Your Project Name
  7. Leave the acess permissions as they are.
  8. Click Finish

If you browse to "http://localhost/TheNameOfTheVirtualDirectory/Default.aspx" you should be able to view the page.

Jason
Upvoted for relevance :)
Maxim