【发布时间】:2008-11-17 23:43:40
【问题描述】:
好的,这一定是一个超级简单的问题。我似乎无法在任何地方找到答案。首先 - 我不是任何类型的网络开发人员,我是一个老派的 c 程序员 - 所以不要因为可能是非常微不足道的事情而抨击我 :)
我需要使用 ASP.NET 编写一个小型概念验证 Web 应用程序。我在这里的第一次尝试是创建一个“Hello World!”应用程序。所以我打开了 Visual Studio,并制作了一个新的 Web 应用程序。我的 Default.aspx 文件调用 Visual Studio 自动创建的 helloworld.dll 中的 C# 函数。
我在本地机器上安装了 IIS,并在 wwwroot 子目录中创建了一个虚拟目录。我将 Default.aspx 和 helloworld.dll 放在该目录中。现在,当我浏览到该页面时,我会看到以下内容。
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
显然,IIS 不知道在哪里寻找 .dll 或类似的东西。我只是不知道如何向 IIS(或在 .net 中管理这些东西的任何人)注册 .dll,以便它可以找到所需的功能。
谁能告诉我如何在 IIS 上“安装”一个 ASP.NET 应用程序?
【问题讨论】:
-
你的代码是什么样的?在 .aspx 和您的 .aspx.cs 中