简体   繁体   English

网络部署

[英]Web Deployment

We had an asp.net 1.1 application that we recently migrated to 3.5. 我们有一个最近迁移到3.5的asp.net 1.1应用程序。 We are facing some problems when we do code modification on the migrated application. 在迁移的应用程序上进行代码修改时,我们面临一些问题。 Here is what is happening 这是发生了什么事

  1. In the asp.net 1.1 application we have the page directive codebehind="ePC.aspx.cs". 在asp.net 1.1应用程序中,我们具有页面指令codebehind =“ ePC.aspx.cs”。 This migrated fine. 迁移良好。
  2. We made some code changes to the .cs file. 我们对.cs文件进行了一些代码更改。 Say for example, we added a button and added the event handler to the button. 例如,我们添加了一个按钮,并将事件处理程序添加到了该按钮。
  3. This new functionality was not getting executed properly. 此新功能未正确执行。
  4. We changed the codebehind directive to codefile directive 我们将codebehind指令更改为codefile指令
  5. Now it is working fine. 现在工作正常。 But during deployment, it asks that the .cs file also be deployed along with the aspx page. 但是在部署期间,它要求.cs文件也与aspx页面一起部署。 We are not sure why this is happening. 我们不确定为什么会这样。

I have attached an example page directive 我已经附上了示例页面指令

In VisualStudio with CodeFile 在Visual Studio中使用CodeFile

<%@ Page language="c#" Codefile="ePC.aspx.cs" AutoEventWireup="True"   Inherits="SPUniversal.Web.ePC" %>

After publishing the website 发布网站后

<%@ page language="c#" autoeventwireup="True" inherits="SPUniversal.Web.ePC, App_Web_eu_mdesx" %>

The App_Web_eu_mdesx got generated automatically in the published website. App_Web_eu_mdesx在发布的网站上自动生成。 I don't understand what is going on here. 我不明白这里发生了什么。 Can you explain? 你可以解释吗?

For 2.0 sites, you have several options of how ASP.Net handles your web site. 对于2.0网站,您可以选择ASP.Net处理网站的方式。 You can use default compilation, or pre-compiled sites. 您可以使用默认编译或预编译站点。 If you use default compilation, you need to have the source files on the server because inn this mode, ASP.Net will re-compile the website dynamically if it detects any changes to any of the source .cs or .aspx files. 如果使用默认编译,则需要在服务器上保存源文件,因为在此模式下,如果ASP.Net检测到对任何源.cs或.aspx文件的任何更改,它将动态地重新编译该网站。

You may want to look into the pre-compilation options available . 您可能需要查看可用预编译选项 By pre-compiling your site when you deploy it, you won't necessarily have to put the .cs files on the server. 通过在部署站点时进行预编译,您不必将.cs文件放在服务器上。

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

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