Question

If I create an Azure package via Visual Studio then it works fine and runs on Azure. If I run the following cmd then the .cspkg that is created is 8,032KB instead of 14,785KB that is created via Visual Studio.

The command line generated .cspkg should be larger than via Visual Studio as the afterbuild event creates additional css / javascript files.

I want to run it via the command line as when I deploy the project locally it compresses/minifies in the afterbuild event and I cannot work out how to make the Azure Package be created after that process so I thought I would do it this way instead.

cspack.exe C:\blah\Azure\ServiceDefinition.csdef 
/role:Project.Web;C:\blah\Deploy 
/sites:Project.Web;Web;C:\blah\Deploy 
/rolePropertiesFile:Project.Web;C:\blah\AzureRoleProperties.txt 
/out:C:\Package.cspkg

The ServiceDefinition has:

<Site name="Web" physicalDirectory="..\Project.Web">

My project only has 1 role so I don't understand why via Visual Studio the filesize is almost double, I also can't add .zip to the .cspkg and view the files of my cmd line generated .cspkg.

Was it helpful?

Solution

A couple of things. When you package a project in Visual Studio, it does a build before it does the pack. Just running CSPack doesn't do a build, it just does the packaging. So it could be that one of the directories it's packaging is empty.

It's also worth noting that if a site has the name "Web" then lots of the other parameters (including physical directory) get ignored. To get around this you could try changing the site name, or figure out where it's really pulling things from.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top