13

I am researching a new ASP.Net project that we would like to host in a Windows Azure Web Role. One of the technical requirements of this project is to make use of the full pre-compilation options (non-updatable, single page assembly) of the ASP.Net Web Site project model - as opposed to the ASP.Net Web Application project model.

Is it possible to host ASP.Net Web Site projects in Azure? Best I can tell the project templates for Azure are ASP.Net Web Applications only at the moment.

4

2 回答 2

8

好的,我在同一问题上苦苦挣扎了几天,这是分步指南

(1)将您的网站项目发布到一个文件夹(对于我的情况是“PrecompiledWeb\WebSite1”,它位于我的 azure 项目的子文件夹中)

(2)修改你的服务定义(.csdef),添加一个webrole

<WebRole name="WebSite1" enableNativeCodeExecution="true">
<InputEndpoints>
  <InputEndpoint name="HttpIn" protocol="http" port="80" />
</InputEndpoints>
<ConfigurationSettings />
</WebRole>

(3)在命令提示符处运行以下命令( CSPack )

cspack CloudService1\ServiceDefinition.csdef /role:WebRole4;WebRole4 /role:WorkerRole1;WorkerRole1\bin\Debug;WorkerRole1.dll /role:WebSite1;PrecompiledWeb\WebSite1 /out:CloudService1.cspkg /generateConfigurationFile:"ServiceConfig.cscfg"

(4)基本上你差不多完成了!

祝你好运!;)

于 2009-08-29T15:56:31.880 回答
4

简短的回答是肯定的,但这并不容易。

Azure 的一大优点是几乎所有可复制部署的东西都可以部署到 Azure。因此,您的网站项目可以部署。困难的部分是 Visual Studio 工具目前(并且可能永远不会)支持它。您需要使用CSPack命令行工具来打包您的部署。

于 2009-07-08T16:04:21.883 回答