简体   繁体   English

能否使用 Visual Studio Web Publish 将单个 aspx.cs 文件部署到 Azure Web App(Azure 运行时问题)

[英]Can you deploy single aspx.cs file using Visual Studio Web Publish to Azure Web App (Azure runtime issue)

I've noticed that although I'm able to successfully deploy my web app (ASP.NET) to Azure using web publish in Visual Studio.我注意到,虽然我能够使用 Visual Studio 中的 web 发布成功地将我的 web 应用程序 (ASP.NET) 部署到 Azure。 I'm also able to successfully deploy individual files to the server directory, by right clicking on the file in the solution explorer and clicking publish.通过右键单击解决方案资源管理器中的文件并单击发布,我还能够成功地将单个文件部署到服务器目录。

However, changes to the code behind don't seem to run on the server without publishing the entire solution.但是,如果不发布整个解决方案,对背后代码的更改似乎不会在服务器上运行。 Changes to the HTML/CSS etc are updated and become effective immediately, and the C# code is making it to the server successfully, but the server continues to run the previous code.对 HTML/CSS 等的更改会更新并立即生效,并且 C# 代码已成功发送到服务器,但服务器会继续运行之前的代码。

I have tried restarting the app in azure, and I've added the rules to prevent server caching.我尝试在 azure 中重新启动应用程序,并且添加了防止服务器缓存的规则。

Is there anything that a full web-publish does that the publishing of individual files doesn't do?有没有什么是完整的网络发布可以做的,而单个文件的发布则没有?

Changes to your code (.cs files) are compiled into a code library file.对代码(.cs 文件)的更改将编译到代码库文件中。 This file is saved into the bin folder and will be named like your project, for example yourprojectname.dll .此文件保存在bin文件夹中,并将与您的项目一样命名,例如yourprojectname.dll This is all done by Visual Studio.这一切都由 Visual Studio 完成。

For the changes in your code behind files to work, you need to publish the respective dll files to your host.为了使您的代码隐藏文件中的更改起作用,您需要将相应的dll文件发布到您的主机。

If you publish the project then the required dll files will also be included, so your changes will work .如果您发布项目,那么所需的dll文件也将包含在内,因此您的更改将起作用

Additionally;此外;

You don't really want to publish your cs files at all.您根本不想发布您的 cs 文件。 These are source code and aren't needed by the host server for your application to function.这些是源代码,主机服务器不需要您的应用程序运行。 cs files should be checked into your version control system (ie GitHub repository) cs文件应检入您的版本控制系统(即 GitHub 存储库)

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

相关问题 使用 Visual Studio Online 将 Web 应用程序发布到 azure Web 应用程序 - Publish web application into azure web app using visual studio online 通过更改单个 aspx.cs 文件更新 web 项目 - update a web project by changing single aspx.cs file 网站到Web应用程序:aspx.cs在.aspx中看不到控件 - Web site to Web App: aspx.cs can't see controls in .aspx Visual Studio 2010 C#在aspx.cs上的网页之间遍历 - visual studio 2010 c# traverse between web pages on aspx.cs 如何将.lic文件发布(部署)到Azure Web App服务的根目录? - How to publish (deploy) .lic file to the root of an Azure Web App Service? 在不使用 Visual Studio 的情况下手动将我的 aps.net Web 应用程序部署到 Azure Web 应用程序 - Manully Deploy my aps.net web application to Azure Web app, without using Visual Studio Web应用程序的aspx.cs中的bootstrap控件找不到asp app - bootstrap control in aspx.cs of web form asp app not found 通过网页调试aspx.cs - Debug aspx.cs through web page 发布一个网站项目,以便它创建一个.dll,而不是.aspx.cs文件 - Publish a Web Site project so that it creates a .dll and not .aspx.cs files 在ASP.NET中运行主项目时(使用Visual Studio(2010))如何调试工作目录* .aspx.cs文件? - How can I debug a working directory *.aspx.cs file when running the main project in ASP.NET (using Visual Studio (2010))?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM