precompile期间发布的Azure为Web服务 [英] Precompile during publish for Azure Web Services

查看:257
本文介绍了precompile期间发布的Azure为Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用的 Azure的Web服务没有Web网站的),然后运行里面的ASP.Net MVC 5.1应用程序。

We are using Azure Web Services (not Web-sites) and run ASP.Net MVC 5.1 application inside it.

当我通过发布网络部署的网站,我有一个选项为precompile发布过程:

When I publish web-sites through Web-deploy, I have an option to "Precompile during publishing":

当我发布天青Web服务,我不能在任何地方找到这个选项。任何指针?

When I publish to Azure Web Services, I can't find this option anywhere. Any pointers?

我们的想法是pre-编译意见,所以先打到一个视图不会是时间的处罚通过编写的飞行。

The idea is to pre-compile views, so first hit to a view would not be time-penalised by compiling on the fly.

我看了在剃刀发电机,但它不符合我们的需要。我见过一些其他的选择,但在发布阶段编制的意见是很有道理的为我们的情况。

I've looked on Razor Generator but it does not suit our needs. I've seen few other options, but compiling views at publishing stage makes the most sense for our case.

UPD:
只是供我参考,我已经试过了什么大卫Ebbo建议并的没有工作

推荐答案

调用编译器%WINDIR%\\ Microsoft.NET \\ Framework64 \\ v4.0.30319 \\ aspnet_compiler.exe -m / LM / W3SVC / 1273337584 / ROOT 从Azure的服务器上的命令行似乎会导致编译。临时ASP.Net根目录包含一个目录这会增加在大小和其中包含的文件数量。那么网站编辑后重新启动。那么第一页打开的表现似乎要好很多。

Calling compiler %windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_compiler.exe -m /LM/W3SVC/1273337584/ROOT from command line on the Azure server seems to cause compilation. The Temporary ASP.Net root directory contains one directory this increases in-size and number of files contained within. The site then restarts after compilation. First page open performance then seems much better.

如果我运行这个启动脚本中这是行不通的网站是不是avaible。我想IIS还没有启动。看着做这样的事情天青:如何执行启动任务延迟?

If I run this within a startup script it doesn't work as the site isn't avaible. I guess IIS hasn't started up. Looking at doing something like this Azure: How to execute a startup task delayed?

站点ID似乎不改变为不同的部署。我想能得到该网站的ID了IIS,然后使用它,如果它。

The site ID doesn't seem to change for different deployments. I guess could get the site id out of IIS and then use that it if it does.

所以看起来像做的。是否有更优雅的方式?不明白为什么编译和部署视图文件是这样的苦差事。

So looks like that does it. Is there are more elegant way? Don't understand why compiling and deploying view files is such a chore.

这篇关于precompile期间发布的Azure为Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆