简体   繁体   中英

MSBuild publish and package for Azure

I am working on automating our process of building an Azure-deployable package, and need to understand why Publish and Package behave differently in an unexpected way.

Manually, in Visual Studio 2013, I can create an Azure-deployable package by selecting the project, right-clicking it and selecting Package... from the popup menu and then clicking OK. This builds a c.150MB cspkg file as expected.

I thought that I could replace this an MSBuild command along these lines:

MSBuild project.ccproj /p:Configuration=Release /p:TargetProfile=Cloud /t:Package /v:diag

but this fails with an error about copying a DLL.

If I change Package to Publish:

MSBuild project.ccproj /p:Configuration=Release /p:TargetProfile=Cloud /t:Publish /v:diag

then it succeeds building the package, but builds a c.75MB cspkg file.

I guess my basic question is what is the difference in behavior caused by? And am I doing this right?

The correct target to create a .cspkg is Publish as you can see here .

The Package target is for packaging web-projects.

Regarding the size difference, it is possible that VS builds a debug version. If that's not the case you can actually see the contents of the .cspkg and figure out what's the difference. You can rename the .cspkg to .zip and unzip the contents, then rename your roles .cssx files to .zip and unzip them as well. Those are the binaries of the roles. You can compare the contents between the two different builds and see the differences.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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