简体   繁体   English

更新已发布的asp.net网站

[英]updating published asp.net website

I just publish an asp.net website then i made changes in its source code i added two .aspx files and then publish it again 我刚刚发布一个asp.net网站,然后我对其源代码进行了更改,我添加了两个.aspx文件,然后再次发布

The question is what I need to make this changes take effect on server. 问题是我需要使这些更改在服务器上生效。 Do I have to replace all files or i can just add specific file? 我是否必须替换所有文件,或者我只能添加特定文件?

I'm trying to add two aspx pages to the site that already exist on the server and want to know which file i have to add beside the ordinary aspx file to take effect on site 我正在尝试将两个aspx页面添加到服务器上已存在的站点,并想知道我必须在普通的aspx文件旁边添加哪个文件才能在站点上生效

Thanks 谢谢

This depends on how you are deploying your code. 这取决于您部署代码的方式。 Are you using the precompile option before publishing or just publishing with pre-compilation. 您是在发布之前使用预编译选项还是仅使用预编译进行发布。

If you are just publishing then you can just replace the .aspx and aspx.cs files and the site will dynamically recompile. 如果您刚刚发布,那么您只需替换.aspx和aspx.cs文件,该站点将动态重新编译。

If you have pre-compiled it then you are probably only left with .dll files and .aspx files so you would have to deploy a new copy of the .dll file for your site and the .aspx files. 如果您已预先编译它,那么您可能只剩下.dll文件和.aspx文件,因此您必须为您的站点和.aspx文件部署.dll文件的新副本。 MSDeploy replaces the entire site by default. 默认情况下, MSDeploy替换整个站点。

If you have only changed the aspx file and not the code behind it is enough to publish those two files and on the server. 如果您只更改了aspx文件而不是后面的代码就足以在服务器上发布这两个文件。 If you have changed the code behind as well you also need to publish the dll files, in that case it's probably easier to replace all of the files. 如果您已经更改了代码,那么您还需要发布dll文件,在这种情况下,更换所有文件可能更容易。

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

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