简体   繁体   English

ASP.NET 4.0从VS2010发布Web应用程序

[英]ASP.NET 4.0 publish a web application from VS2010

I am not very familiar with publish feature.But here is the scenario I have developed a web application in VS2010- I was under the impression that it will be the home page of the site.But the client now wants it deployed to a sub directory of existing web site.So I chose an FTPpublish to the sub directory from VS2010. 我对发布功能不是很熟悉,但是在这种情况下,我在VS2010中开发了一个Web应用程序-我的印象是它将成为站点的主页,但是客户端现在希望将其部署到子目录中因此,我从VS2010选择了一个FTP发布到子目录。 The publish works well but problems arise when I try to access it using www.existing.site.com/Mydirectory/default.aspx 该发布效果很好,但是当我尝试使用www.existing.site.com/Mydirectory/default.aspx访问它时会出现问题

I then get the error that it cannot find site.master which is defined in default.aspx as 然后,我得到一个错误,它找不到在default.aspx中定义为的site.master

<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master"
    CodeBehind="Default.aspx.vb" Inherits="Schedule" %>

So I change the reference to Master as MasterPageFile="Site.Master" - this leads to error Class Site not found. 因此,我将对Master的引用更改为MasterPageFile =“ Site.Master”-这导致找不到类站点错误。

I am thinking I need to do some simple configuration change ??? 我想我需要做一些简单的配置更改?

Also what about web.config ? 还有web.config呢? Should I deploy my web.config to the sub directory? 我应该将web.config部署到子目录吗?

You can install a web application in: 您可以在以下位置安装Web应用程序:

  1. root
  2. virtual directory 虚拟目录

So check that Mydirectory is defined as a virtual directory in IIS and configure the application pool for the right .Net Framework you used. 因此,请检查Mydirectory是否已在IIS中定义为虚拟目录,并为您使用的正确的.Net Framework配置应用程序池。

If you develop web app from 1.0 to 3.5sp1 .net framework you can configure IIS both with 2.0 or 4.0 如果从1.0到3.5sp1 .net框架开发Web应用程序,则可以将IIS配置为2.0或4.0

If you develop your wep app for 4.0 framework you need IIS 7.0 or more and configure app pool for 4.0 如果为4.0框架开发wep应用程序,则需要IIS 7.0或更高版本,并为4.0配置应用程序池

So copy you web application in the sub directory folder: 因此,将您的Web应用程序复制到子目录文件夹中:

  • copy ALL bin folder 复制所有bin文件夹
  • copy all aspx, ascx 复制所有aspx,ascx
  • copy web config. 复制Web配置。
  • copy all static content 复制所有静态内容

I suggest also you to take a look at MSDeploy 我建议您也看看MSDeploy

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM