简体   繁体   English

加速ASP.NET网站发布

[英]Speeding up ASP.NET website publishing

Is there any way in ASP.NET website project, that allow to publish it from command prompt and I can continue working on project, or if it is not easy to use , at least speed up my publish task? 在ASP.NET网站项目中是否有任何方法允许从命令提示符发布它,我可以继续处理项目,或者如果它不容易使用,至少加快我的发布任务?

I know about the auto publishing tools like TFS or CruiseControl, so please don't tell me these ways. 我知道TFS或CruiseControl等自动发布工具,所以请不要告诉我这些方法。

I am thinking to create a .bat file , that I'll run everytime I have to publish. 我正在考虑创建一个.bat文件,每次我必须发布时我都会运行。 but it should not take changes made by me during its running process. 但它不应该在运行过程中对我做出改变。

asp.net single file publish asp.net单文件发布

I really like the Answer given by Ludwo, providing more information on that would be very helpful. 我非常喜欢Ludwo给出的答案,提供更多相关信息会非常有帮助。

You can use MsBuild to publish your websites in parallel. 您可以使用MsBuild并行发布您的网站。 Start with this article . 从这篇文章开始 It is about publishing one website using MsBuild. 它是关于使用MsBuild发布一个网站。 Define your projects inside ItemGroup and use MSBuild task this way: 在ItemGroup中定义项目并以这种方式使用MSBuild任务:

<MSBuild Projects="@(YourProjectsToBuildInParallel)" BuildInParallel="true" ... 

The final step is to enable parallel processing for MSBuild task. 最后一步是为MSBuild任务启用并行处理

Open another Visual Studio to continue :P. 打开另一个Visual Studio继续:P。 Publishing mechanism can detect updated and can send only changes. 发布机制可以检测更新并且只能发送更改。 So dont upload full site everytime, if its really disturbs you. 所以不要每次上传完整的网站,如果它真的打扰你。

Use source control and a build server mechanism. 使用源代码管理和构建服务器机制。 The build server should be able to pull from source control when you commit a change, build the project, do any unit tests you may/should have, and then deploy to a test site. 当您提交更改,构建项目,执行您可能/应该具有的任何单元测试,然后部署到测试站点时,构建服务器应该能够从源代码控制中提取。

Depending on which build server platform you use you may or may have to do varying amounts of work. 根据您使用的构建服务器平台,您可能需要或可能需要执行不同的工作量。 In the past I have used Bamboo by Atlassian. 在过去,我使用过Atlassian的Bamboo。 Fantastic product but you have to configure the deployment using MSBuild - it's fine but it can take some time to get it perfect. 神奇的产品,但你必须使用MSBuild配置部署 - 它很好,但它可能需要一些时间才能完美。 I am sure there are some good examples out there for it. 我相信它有一些很好的例子。

How it will work for you: 它将如何为您服务:

When you are finished working on a file/issue you can commit your changes. 完成文件/问题后,您可以提交更改。 The build server will then detect these changes and wait a varying amount of time (waiting for you to commit more) eg 3 minutes, check out your changes, and deploy. 然后,构建服务器将检测这些更改并等待不同的时间(等待您提交更多),例如3分钟,检查更改并进行部署。 You can set up notifications when the deployment is done to goto your testing team - with a link in the email saying where the site is, and what the change that occurred (based on your SVN commit log). 您可以在部署完成后设置通知以转到您的测试团队 - 电子邮件中的链接指出站点所在的位置以及发生的更改(基于您的SVN提交日志)。

So your net effort is to check a file in with a correct comment - and you are finished. 因此,您的最大努力是使用正确的注释检查文件 - 然后您就完成了。

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

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