Cspack behavior differs from msbuild

Using Visual Studio 2012, Azure SDK 2.1, I am trying to find the best way to create a csx folder to work in azure emulator. I understand that the csx folder is not created until I pack the Azure project. I can create the package manually from Visual Studio, but this is not an option for automatic assembly. Another option is to create the package using the msbuild command line. This seems a little difficult, as it will actually be an assembly that takes more time than just repackaging.

So, I thought cspack might be easier. However, when I call cspack with the following command line:

cspack.exe ServiceDefinition.csdef / copyOnly

I get an error: you need to specify a physical directory for the virtual path "Web /" of the MyProjWeb role.

But I am not doing anything like this when using msbuild. I read a bunch of things about specifying a physical directory and some of the confusion it might cause. Therefore, I would prefer not to use it if it is absolutely necessary, especially since I do not need to specify this when creating from msbuild.

So my main question is: what is msbuild, what does cspack do, and what to do with cspack? My other question is: what is the easiest way to create a csx folder for testing in an azure emulator?

Change - Resolution

I thought I would say how I solved it here if it helps someone else. The great answer to my question (thanks to Chandermani and some other reads) is that CSPack with / copyOnly is basically a fancy xcopy for folder structure according to some rules. If you do not use / copyOnly, it also creates an attractive zip code to create the package. Do not complain, it’s wonderful that it’s easy, but it’s good to know from the very beginning. You can use it to pack something for azure not related to what can be created in Visual Studio, for example. PHP site. Using msbuild has the added benefit of only copying files that are part of your website deployment.

, , CSPack mvc, , , . , . , , -, CSPack . , , .

, postbuilder msbuild -, , Azure, cspack msbuild azure package (do cspack , -). , , , msbuild . , post azure - - :

"C:\Program Files\Microsoft SDKs\Windows Azure\Emulator\csrun.exe" /devfabric:shutdown > NUL
"C:\Program Files\Microsoft SDKs\Windows Azure\Emulator\csrun.exe" /devstore:shutdown > NUL
if $(ConfigurationName) == Debug set CONSTANTSPARAMETER=DEBUG
if $(ConfigurationName) == Release set CONSTANTSPARAMETER=
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe $(ProjectDir)$(ProjectFileName) /t:clean;publish /p:Configuration=$(ConfigurationName) /p:TargetProfile=cloud /p:OutputPath=bin\Cloud$(ConfigurationName) /p:VisualStudioVersion=11.0 /p:overwritereadonlyfiles=true /p:DefineConstants="%CONSTANTSPARAMETER%" /verbosity:minimal /p:PostBuildEvent=

.

. , #if DEBUG msbuild. , , DEBUG . , , DEBUG.

msbuild . :

/: PostBuildEvent =

postBuildEvent , - . ...

/p:VisualStudioVersion=11.0

Microsoft Visual Studio 2010, 2012 . , , msbuild MSB4019, Visual Studio Azure.

, . csx, , , . , ServiceConfiguration.Local.cscfg.

Edit: . , - , , - , obj, proj , , " ".

, msbuild , , . - CSPack? , CSPack? , - , csx ( ..). ? - Azure, . , . , , Visual Studio , packageOnBuild Azure, copyOnly . . : DeployOnBuild, csproj.

, , csx, , dev. , Visual Studio . , , .

+3
1

msbuild azure , .

cspack , . cspack , web\workerrole. csdef . , cspack. ( CopyOnly). , script.

+1

All Articles