Could not load file or assembly 'System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified
Thursday, April 26, 2012
"Add Deployable Dependencies" option in Visual Studio 2010 When you want to deploy ASP.NET MVC application
Could not load file or assembly 'System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified
Thursday, February 16, 2012
Swap VIP in Window Azure
What is SWAP VIP ?
There are 2 type of environment on which you can deploy on window azure application.
Staging
In other word you can say testing environment, having similar configuration as per production. Before deploying to production (where actual user will use your application) you can deploy to staging to fix bugs, test security issues, configuration problem etc.
Production
It is actual environment where you can move tested staging application which will be used by real users. (you can directly deploy your application if you are confident on your testing!!)
In sort Swap VIP is azure feather to move application from staging to production by just one click!
How to use Swap VIP?
After testing your application just click on Swap VIP as per shown in above fig.and click ok and it will transfer from staging to production with zero downtime of your original application!
What will happen while swapping?
If you have notice DNS when you have created staging would be as per below.
ID + Cloudapp.net
When you going to swap azure will just transfer this DNS entry.
Reference Links
- More info on SWAP VIP on msdn
- Swap VIP with screenshots
- Step by Step: Publishing your application and Swap VIP
- Make sure about your configuration setting when you will swap VIP
- Deploying application using azure management portal
Step by Step : Upload asp.net web application to Window Azure
Create New Project > ASP.NET web application
Create New Cloud Project and Just click OK without selecting anything
Go to Cloud Project > Right click on Roles Folder > Add web role from solution as per below fig.
Here you can configure your cloud project with .csdef config file (you can also add stratup task in that.)
Build Solution then right click on Cloud Project and click Publish, it will open dialog as per below.
Here i will go through "Create Service package only" which will create published files to upload manually on window azure portal, if you want details on 2nd option then please refer this link for Getting Started with the Windows Azure Tools for Visual Studio
- Click on "Configure Remote Desktop" if you want RDP connection to that application and chose certificate and credentials as per below
Click Ok on both dialogs and it will generate 2 files which we need to upload on Window azure portal
Create "New Hosted Service" on azure portal then fill details, choose certificates and browse 2 published files in step-9 and click ok
cheers!
Monday, December 26, 2011
Handle chart rendering on multiple instance of Azure webrole application
Generally when we add graph , at that time in web.config handlers will be added automatically as per below
and to store graph images in folder we need to put app-setting as per below
in this case graph data point will be plotted and image will generated and store that in temp folder (as per appsetting)
and on request that image will be displayed on page .
Now this will work well in window azure up to 1 instance but when you will make more then 1 instance at that time sometimes graph will be empy. why?
because if one request store that image in first server of stack then another request want that graph from different server of stack and it can not able to find there!
So how we can handle this issue on multiple instance
simple solution is instead of temp location we need to use blob storage provided by Azure.
generally chart control will use custom charthanlder for handling to store images of chart so we need to make custom chart handler that will store chart images in blob storage and from there it will be serve in all instances.
Just code your custom handler as per below
you need to add reference of this dll found in window azure SdK at C:\Program Files\Windows Azure SDK\v1.3\ref
Microsoft.WindowsAzure.StorageClient.dll
and in web.config just assign that handler in appsetting as per below
Friday, December 23, 2011
Session state in Window Azure using caching
1) Create a Cache in Windows Azure
Open management portal , click on servicebus & caching option as per shown in fig-1.

Expand services and click caching , create new namespace as per shown in below fig.

Select service (here cache) add namesapce, location and subscription as per shown in fig

click to view client configuration file.


http://msdn.microsoft.com/en-us/library/gg618004.aspx
2) Prepare Visual Studio to Use Caching for Windows Azure
Verify that the target framework version is .NET Framework 2.0 or higher (non-client profile).
open web.config copy portion of configsection , datacacheclient in web.config,
copy Sessionstate section under system.web
http://msdn.microsoft.com/en-us/library/gg278344.aspx
Related Links
http://www.windowsazure.com/en-us/develop/net/how-to-guides/cache/
http://weblogs.asp.net/shijuvarghese/archive/2011/05/04/usi
ng-windows-azure-appfabric-caching.aspx
http://www.codeproject.com/KB/azure/WA-AppFabric-cache.aspx