构建一个azure云项目 [英] Build an azure cloud project

查看:65
本文介绍了构建一个azure云项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我正在尝试使用Powershell构建(然后发布)Azure项目。


我是什么到目前为止已完成(以下文章:  https://docs.microsoft.com/en-us/azure/cloud-services/cloud-services-dotnet-continuous-delivery)


 function Get-ScriptDirectory 
{
Split-Path $ script:MyInvocation.MyCommand.Path
}

$ currentPath = Get-ScriptDirectory

[string] $ Path_MS_BUILD =" C:\Program Files(x86)\ MSBuild\14.0 \ Bin \ MSBUILD.exe" ;

$ Publish_Stagging_Profile =" Publish_Stagging"

& $ Path_MS_BUILD $ PublishVersion_PathToResources / t:Publish / p:PublishProfile = $ Publish_Stagging_Profile

在visual studio中我有一个名为  Publish_Stagging.azurePubxml的个人资料,其中包含23行,包括这些:

 

< AzureServiceConfiguration> Cloud< / AzureServiceConfiguration>

< AzureSolutionConfiguration> Release< / AzureSolutionConfiguration>

然而,当我运行我的Powershell并检查我的文件夹时,它会更新我项目的bin / Debug文件夹。


你知道吗?为什么?



谢谢

解决方案

您好User11990,


感谢您在此处发布。


这是因为默认构建配置设置为"活动(调试)"在Visual Studio中。当您 ublish项目而未将构建
配置设置为"Release"时,Visual Studio将使用"Debug"构建项目。模式,所以文件更新bin / Debug文件夹。

< AzureSolutionConfiguration> Release< / AzureSolutionConfiguration> 




Publish_Stagging.azurePubxml中的此配置用于将Azure辅助角色设为 发布。



Hello,

I'm trying to build (and then publish) an Azure project with Powershell.

What I've done so far (following this article : https://docs.microsoft.com/en-us/azure/cloud-services/cloud-services-dotnet-continuous-delivery)

function Get-ScriptDirectory
{
    Split-Path $script:MyInvocation.MyCommand.Path
}

$currentPath = Get-ScriptDirectory

[string]$Path_MS_BUILD="C:\Program Files (x86)\MSBuild\14.0\Bin\MSBUILD.exe"

$Publish_Stagging_Profile="Publish_Stagging"

& $Path_MS_BUILD $PublishVersion_PathToResources/t:Publish /p:PublishProfile=$Publish_Stagging_Profile

In visual studio I have a Profile called Publish_Stagging.azurePubxml which contain 23 lines including these ones :

<AzureServiceConfiguration>Cloud</AzureServiceConfiguration>

<AzureSolutionConfiguration>Release</AzureSolutionConfiguration>

However when I run my Powershell and check my folder it updates the bin/Debug folder of my project.

Do you know why ?

Thank you

解决方案

Hi User11990,

Thanks for posting here.

That is because the default build configuration is set to "Active (Debug)" in Visual Studio. When you publish the project without set the build configuration to "Release", the Visual Studio will build the project with "Debug" mode, so files are update the bin/Debug folder.

<AzureSolutionConfiguration>Release</AzureSolutionConfiguration>


This configuration in the Publish_Stagging.azurePubxml is used to make Azure worker role as Release.


这篇关于构建一个azure云项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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