如何部署ASP。不创建单独站点的IIS上的NET web ?

时间:2021-10-17 06:24:55

I've created an ASP.NET web tool that will just be used by a few people in my team where I work. I deployed it on our internal (Win2k, IIS6) web server by creating a new website in IIS and assigning it port 81. Users can access it with an address like http://myserver:81. All the other web stuff on the server is classic ASP and is accessed with addresses like http://myserver/path/to/myfile.asp.

我创建了一个ASP。NET web工具,在我工作的团队中,只有少数人会使用它。我将它部署到我们的内部(Win2k, IIS6) web服务器上,通过在IIS中创建一个新网站并分配它的端口81。用户可以使用http://myserver:81这样的地址访问它。服务器上的所有其他web内容都是典型的ASP,可以使用http://myserver/path/to/myfile.asp这样的地址进行访问。

This works fine, but I'd rather set it up so that the ASP.NET app is not configured as a separate web site, and is just accessed via a folder path like the classic asp stuff. That way users wouldn't have to specify the port and we wouldn't get the overhead of an additional web site for every little ASP.NET app we make.

这很好,但是我宁愿设置成ASP。NET应用程序不是作为一个单独的web站点配置的,它只是通过一个文件夹路径(比如经典的asp)来访问。这样,用户就不必指定端口,我们也不会为每一个小ASP获得额外的web站点的开销。网络应用程序。

The problem is when I build the site in visual studio, it compiles all the .cs files into one .dll file, and if I just copy everything over to some folder on the server and type the address of the .aspx file, it can't seem to access any of the c# functions in that .dll file.

问题是当我在visual studio构建网站,它将所有的cs文件编译为一个. dll文件,如果我只是复制所有服务器上的文件夹和类型的地址。aspx文件,它似乎无法访问任何c# . dll文件的功能。

Can an ASP.NET app be set up like this, short of writing all C# code within the .aspx files?

可以一个ASP。NET应用是这样设置的,不需要在.aspx文件中编写所有c#代码?

1 个解决方案

#1


2  

Assuming you want your application to run as a subfolder of a website bound to http://192.168.1.1:

假设您希望应用程序作为绑定到http://192.168.1.1的网站的子文件夹运行:

  1. Build your website, and drop it into a subfolder called "A" in the root website folder

    建立你的网站,并把它放到根网站文件夹中的一个叫做“a”的子文件夹中

  2. Verify that Network Service and IUsr accounts have read access (at least) to your Subfolder

    验证网络服务和IUsr帐户是否已将访问(至少)读到您的子文件夹。

  3. Verify that the application pool serving the website is using the same version of the .NET Framework as your application (Probably 2.0 if you're using IIS 6)

    验证服务于网站的应用程序池使用的是与应用程序相同的。net框架版本(如果使用IIS 6,可能是2.0)

  4. Verify that the application pool is running under the Network Service Identity

    验证应用程序池在网络服务标识下运行

  5. Right click the folder in IIS, and convert it to an application

    右键单击IIS中的文件夹,并将其转换为应用程序

  6. Make sure you setup an adequate default file on the application, such as default.aspx

    请确保在应用程序上设置了足够的默认文件,例如default.aspx

  7. Access http://192.168.1.1/A/ and your application should load

    访问http://192.168.1.1/A/,您的应用程序应该加载

Note: All applications in the website must run the same version of the .NET Framework

注意:网站中的所有应用程序都必须运行。net框架的相同版本

#1


2  

Assuming you want your application to run as a subfolder of a website bound to http://192.168.1.1:

假设您希望应用程序作为绑定到http://192.168.1.1的网站的子文件夹运行:

  1. Build your website, and drop it into a subfolder called "A" in the root website folder

    建立你的网站,并把它放到根网站文件夹中的一个叫做“a”的子文件夹中

  2. Verify that Network Service and IUsr accounts have read access (at least) to your Subfolder

    验证网络服务和IUsr帐户是否已将访问(至少)读到您的子文件夹。

  3. Verify that the application pool serving the website is using the same version of the .NET Framework as your application (Probably 2.0 if you're using IIS 6)

    验证服务于网站的应用程序池使用的是与应用程序相同的。net框架版本(如果使用IIS 6,可能是2.0)

  4. Verify that the application pool is running under the Network Service Identity

    验证应用程序池在网络服务标识下运行

  5. Right click the folder in IIS, and convert it to an application

    右键单击IIS中的文件夹,并将其转换为应用程序

  6. Make sure you setup an adequate default file on the application, such as default.aspx

    请确保在应用程序上设置了足够的默认文件,例如default.aspx

  7. Access http://192.168.1.1/A/ and your application should load

    访问http://192.168.1.1/A/,您的应用程序应该加载

Note: All applications in the website must run the same version of the .NET Framework

注意:网站中的所有应用程序都必须运行。net框架的相同版本