Tuesday 28 October 2014

SharePoint - Unable to create New WebApplication

Problem

I recently faced a problem with SharePoint, that I created new Web Application and it was showing a popup of "It shouldn't take long", then after some time it showed a Connection failure page. I browsed to the virtual directory folder for the new web application and found that the folder was totally empty.

Solution
Then what I did to solve this problem:


1. Open IIS
2. Go to Applicatin Pools
 3. Select Central Admin application pool and right click and select "Advance Settings".
4. There was a property named "Shutdown Time Limit", it was set to "90" by default.
    I changed it to 400 and clicked OK.
 
It restarted the applicaition pool automatically. Then again I created new web application from central admin and it worked for me.

Saturday 20 September 2014

Item Created time zone displays wrong programatically - SharePoint List

Problem:
Recently I faced an issue, that I was having a Log field with Version enabled list. Time was being displayed correctly in the SharePoint list but while retrieving CREATED field time programactially for all versions of item, it was displaying wrong time.

I was using below statement to retrieve time for CREATED date:
version.Created.ToString("dd/MM/yyyy hh:mm tt")
My timezone was though set to +3 Region, but it was showing GMT time with +0 Regional time settings.

Solution:
Then I change the above line to:

System.TimeZone.CurrentTimeZone.ToLocalTime(version.Created).ToString("dd/MM/yyyy hh:mm tt")
This done the trick for me.

Hope this helps someone!

Test Email without sending Email to User - C# / C-Sharp - DotNet

Sometimes we may want to test email functionality without sending email to actual user. Email will be saved locally so that we can verify ...