Tuesday, April 12, 2011

Windows Azure – Opening Cloud Service Package files

Windows Azure – Opening Cloud Service Package files –

When you build and then publish a cloud service project in VS2010, the resultant file is called as Service Package. The file extension is always -.cspkg.
When you want to host your web role or Worker role in Azure, you use this service package file for uploading to Azure.




Consider a scenario where you have created Service package file and you upload it to Azure. Unfortunately while running the web page, you received an error stating that, “Could not load assembly”. The common cause of this error is, the required DLL do not get copied to Azure service package when you had published it in development fabric, and ultimately it is missing in Azure fabric cloud environment also.

So, how can you check that, your published version of Service Package contains all the required DLL’s or not?
The single file Service Package is zipped and encrypted so you won’t be able to browse through it unless you set an environment variable to create service package without excryption.
First close all visual studio applications, then right click on “My Computer”, select “Properties”, select “Advanced System Settings” option.
You will find a button labeled as “Environment Variables”. Click on the button. A pop up will appear.


Under “System Variables” panel click NEW. Put “Variable Name” as “_CSPACK_FORCE_NOENCRYPT_” and “Variable value” as “true”. Click OK.

After publishing your cloud service project, you will be able to open the Service Package file either using WinZip or Winrar.
Hope this helps in debugging type of activities and understanding your service package file in much better way.
Cheers…

Please give food to all my fishes swimming at the bottom. It's fun!! Try it!!
Thanks for reading!!
Happy coding.
Note:  The steps to create an unencrypted package are for debugging purposes only and should not be used for production packages.  Additionally, the method is only intended for internal use, is not supported and may be changed by Microsoft.

No comments:

Post a Comment