Friday, June 29, 2018

Mercurial: “Waiting for lock on working directory of”

Mercurial: “Waiting for lock on working directory of”

Problem: Mercurial commits time out with message “waiting for lock on working directory of <Repo - PATH> held by ” “.
Solution: go to .hg folder in working directory and delete file named “wlock”

Tuesday, June 9, 2015

operation is not valid due to the current state of the object sharepoint 2013 deploying solution

This issue has been haunting me for two days and I was unable to figure out the root cause and how to get it resolved.


After searching on different blogs for a good enough time it became frustrating because I was unable to deploy my solution and there was a demo.


For me it happened because I had refreshed the cache.ini file present at %ALLUSERSPROFILE%\Microsoft\SharePoint\Config\ path in your SharePoint farm.

I had reset the cache.ini file by changing its content to 1 but unfortunately my cache didn't get reset properly. After restarting the server, SPTimerService and all repeatedly following several blogs it didn't resolve my issue.


The fix was I had to create a folder in the same directory where I had cache.ini with the same name as the id of content database. Doing just that created several xml files in the folder and I got everything working once again.

You can find the config DB key from the following place in your registry:

Run - regedit
Expand the following key 
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\15.0\Secure\ConfigDB

and copy id. 

Go back to the config folder and create a new folder with the same name as id and that's all!

You will see the magic and now you can resume with your work.


Monday, November 10, 2014

Logging Utility

Background

Sometimes you need to introduce excessive logging in a workflow, web application, complex runtime application logging is a very important thing in order to identify issues. I have a logger by looking into various loggers available over the web. The sole purpose of this logger for me was to be applied to a workflow which was written in C# using Windows Workflow Foundation.

Logging seems quite easy if it's an application which runs one time or is a sequential one where the rate of concurrent users is less or negligible you just write all the logging lines down in a file and that's all. But imagine when there are multiple people working on an application for which you are logging you will definitely come across the issue of writing to the file when it's already in use.

Implementation Details 


Here are details of the workflow with a test application; I have tried up to 20 threads which are trying to access the file for writing and its working fine.


Monday, March 17, 2014

Handling the UnauthorizedAccessException in SharePoint Visual Web Part


I came across an issue lately where I had to allow different users to access a web part with each having their own permissions set for a document library.

Some of the users might not have access on the web part or even the library that we have configured with this web part to be shown. So in order to by pass the automatically getting redirected to access denied page we need to run the code in this scope


using (new SPSecurity.SuppressAccessDeniedRedirectInScope())
{
   //Your custom code here
}


That's all that helped me get through this painful situation.

Saturday, September 14, 2013

Suppress Javascript Errors

There are times when we see, due to any reason, our javascript in the page starts throwing errors. Hence if some one is browsing the page using Internet Explorer, they might come across the annoying popups if they have configured the Internet settings like that, this is where this Tutorial might come in handy for a few coders like me tackling the situation.

Again it's not a solution it's just a way to handle and tackle the issues, I would still say if you have time in your hand go through your javascript and get it fixed. This snippet must be used if and only if, you are out of time and options.



I hope it gives peace to someone in need!


Wednesday, September 11, 2013

SharePoint 2014 Conference

Dear All,

Microsoft SharePoint conference is back! You can get the details to register on the following link Details

SharePoint Conference offers a wide variety of presentations, labs, certification testing, Q&A sessions, workshops, and networking events for attendees to build their skills and meet other SharePoint professionals. Along with the best new content, industry trends, and product announcements, SharePoint product managers, engineers, and other experts will be answering questions, giving presentations, and hosting discussions

Sunday, September 8, 2013

Custom Document Library Viewer SharePoint 2013 part 1

Lately I came across an interesting task and was able to successfully deliver it. I know that we have a Custom Library Viewer in SharePoint OOTB. I had a different requirement from the one already present in the SharePoint. I had been asked to develop a Custom Document Library Viewer based on Content Types and also display each of the content type in a separate tab.

So, the requirement was something like that for instance in a document library I have 4 different kinds of content types and there are several items in it. I will have to show 4 different tabs and also display the items in each tab using a grid. Interesting isn't it?!

Yea so this gave birth to a new generic web part based on jQuery tabs, and jQGrid. Which is configurable to use any document library, hosted on any website and user can choose which content types to show for a particular library!

Genius isn't it, alright so stay tuned I will be sharing the implementation details in the next post.