Skip to main content

The Execute method of job definition “SPSolutionDeploymentJobDefinition” threw an exception, Value cannot be null.

I have developed an Timer Job Definition,feature & feature receiver to create the timer job.

On WSP deployment on my local machine it install with no issue 🙂

Now when deploying on the WebFarm environment with a Front end server , I faced following error.

The Execute method of job definition “SPSolutionDeploymentJobDefinition” (id “030bb074-94a8-4f5d-bf34-b4ca735c1693”) threw an exception. Failed to create feature receiver object from assembly “Company.Project.Business, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1f12345e9c67bc89”, type “Company.Project.Business.EventReceivers.MyTimerJobFeatureReceiver” for feature C0857DB8-1636-11E0-AC62-40DFDED72085: System.ArgumentNullException: Value cannot be null.
Parameter name: type
at System.Activator.CreateInstance(Type type, Boolean nonPublic)

at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()

Initially I thought It is something wrong with the Event Receiver Class and the application could not find the class. Changed the scope of Class, changed the name of the class, restarted IIS, But I no result.

After two hours of troubleshooting, I restarted

Get PageLayout Name in Sharepoint but having a performance issue

I googled and found one of the easy way to get the PageLayoutName.

if (PublishingWeb.IsPublishingWeb(web))
{
PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(web);
PublishingPageCollection publishingPages = publishingWeb.GetPublishingPages();
PublishingPage publishPage = null;
var spfile = SPContext.Current.File;
Guid id = spfile.UniqueId;
if (publishingPages[id] != null)
{
publishPage = PublishingPage.GetPublishingPage(publishingPages[id].ListItem);
currentPageLayout = publishPage.Layout.Name;
if (currentPageLayout.EndsWith(".aspx"))
{
currentPageLayout = currentPageLayout.Substring(0, currentPageLayout.Length - 5);
}
}
}

The above code is having a heavy performance issue as I am getting all the PublishingPages and searching is in Pages.

One of the already ways is to use CAML Query in

SharePoint/MOSS Enter Key On Search Box Not Working In Firefox

I cam across a strange situation where the page of my SharePoint website just refreshes itself when I search on my site using the Enter key. I noticed this was only a problem when I use Firefox.

On Goggling I found following solutions

http://social.msdn.microsoft.com/Forums/en-US/sharepointecm/thread/87574c13-91d6-48fe-8346-01e77e0094b3

http://blog.drisgill.com/2009/08/firefox-doesnt-respond-to-enter-key-in.html

http://blogs.msdn.com/b/jjameson/archive/2009/10/01/enter-key-does-not-submit-search-in-moss-2007-from-firefox.aspx
I modified the solution by Jeremy Jameson, to suit my requirements.

    <script language="javascript"> function replaceOnKeyPress()
    {
    var theInputID = $("input[name$='InputKeywords']").attr("id");
    if(typeof(theInputID) != "undefined")
    {
    var theFunction=theInputID.replace("InputKeywords", "");
    var LastindextOf =theFunction.lastIndexOf("");
    if (LastindextOf >0)
    {
    theFunction=theFunction.substring(LastindextOf+1,theFunction.length);
    theFunction = theFunction + "_Submit();";
    var txt = document.getElementById(theInputID);
    var browser = navigator.appName;
    if (txt && (browser == "Netscape"))
    {
    txt.onkeypress = function(e)
    {
    var key = String.fromCharCode(e.keyCode);
    if (key == "\n" || key == "\r")
    {
    eval(theFunction);
    return false;
    }
    }
    }
    }
    }
    }
    replaceOnKeyPress();
    </script>

Custom SharePoint 404 page works in IE but shows HTML tags in Firefox

A strange thing I noticed is My404Page was not working properly on Firefox, I then tested it on IE and it worked.

When I browse my website it shows the HTML tags on the page.

clip_image002

When I test the site using https://dewani.net/123.aspx My custom 404 page showed up correctly

When I test the site using https://dewani.net/123 My custom 404 page showed up HTML tags.

When I digging and goggling I found it