Reputation: 3598
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">
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?
Upvotes: 2
Views: 537
Reputation: 8640
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:
If you browse to "http://localhost/TheNameOfTheVirtualDirectory/Default.aspx" you should be able to view the page.
Upvotes: 2
Reputation: 13699
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.
Upvotes: 1
Reputation: 21323
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..."
Upvotes: 4