Tuesday 25 November 2014

Deploy dll to GAC on Win2k8 and Win2012

I had a requirement where I had to deploy a bug fix which was a simple dll into GAC on production server. The problem came when there wasn't gacutil tools available on that server. So I went to my development server and copied those files over to production. But from which folder?
Mine was from "C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin". There I found folder called NETFX 4.0 Tools. Then I copied all files from that folder to production server and ran it from there.
This has been tested on Windows 2008 R2 and Windows 2012.

Thursday 20 November 2014

Control lost its state (viewstate) during postback

I want to share my experience during deployment of a new custom application which was develop on top of SharePoint Server 2013. The application was an upgrade version of existing application which had been run well under SharePoint 2007. Long story short the application has been upgraded and verified. I installed this application under SharePoint Server 2013 which act as application server and WFE (server on the cloud), and I joined to another server which has much bigger memory capacity (physical server) which also act as application and WFE. That server also has Project Server 2013 installed, both server has been upgraded to SharePoint and Project Server 2013 SP1.
The next day when users started to use that application, I received many email from users that they couldn't submit theirs request because they have experienced error (looking at ULS it was nullreferenceexception). Looking at trace information that exception was come from a method that take it's value from aspx dropdownlist control. I checked the code and didn't find anything that could related to this error. I asked user to provide me with screen capture before and after the error. To my surprise all aspx web controls has been lost its value during postback. dropdownlist become empty, label become empty and all aspx web controls was lost it's state during postback.
I spent 3 days to figure out what could happen, and that error didn't happen to anyone and happened randomly not just on some button click. During that time I had also noticed that the memory server was utilized at 96-98 percent (this was 16GB server on the cloud). Since this was farm installation, I stopped distributed cache and project server app services on that server. I tested that application with this configuration and the lost control state was still happened. Then I tried accessing that application from another WFE which has twice bigger memory. It was running well without that error.
After 2 weeks of investigation I discovered that the problem came from distributed cache, It looks like aspx or SharePoint store it's viewstate on that distributed cache, and when application trying to get its state back that information got lost during transport from distributed cache server to my application. Network latency between those server hasn't been good during peak hours and using ping command it's sometimes display Request time out. SharePoint default timeout request cache information from distributed cache was set at 20ms. Which was very narrow gap, so I increased that timeout to 80ms. I've also removed distributed cache service from that server.

This blog pointing some got guide on how to troubleshoot this error.