Monthly Archives: March 2011

SharePoint 2010 Solution Stuck in “Deploying” Status

I used PowerShell to deploy a solution to a SharePoint farm (h/t:  Corey Roth and his blog post). 

I then went to the central admin, accessed System Settings and then “Manage farm solutions” to deploy it to the farm and to my (slight) dismay, it got stuck in “deploying”.

I’ve seen this issue come up many times on the MSDN forums, so I was pretty nervous about it.  I searched around a bit and found this helpful article (by a seemingly unattributed person from http://www.resolutionsnet.co.uk/).  I cancelled the deployment job and when I clicked into the solution, it told me that it had successfully deployed the solution to three of the four servers in the farm.

I went to the errant server, stopped the timer service and restarted it.  Windows server actually told me that the service failed to respond to the command, so that tells me that it was sick.

This time, when I went back to central admin, I was able to deploy it with no problem.

Hopefully this bit of info will help some in a bind one of the days.

</end>

Subscribe to my blog.

Follow me on Twitter at http://www.twitter.com/pagalvin

Error of the Day: “Cannot Add the Specified Assembly to the GAC”

I’ve been fighting a bit with visual studio 2010 on a an sp2010 solution and was getting this error:

Error occurred in deployment step ‘Add Solution’: Error: Cannot add the specified assembly to the global assembly cache: YourAwesomeDLLThat IAmJustNotGoingToInstallRightNow.dll

I went to the GAC itself (c:\windows\assembly) to try and remove and got a “file in use” error.

I did an iisreset, I almost downloaded sysinternals, I stopped the timer service in services… finally, I just closed and reopened visual studio itself and I was finally able to close it out.

</end>

Subscribe to my blog.

Follow me on Twitter at http://www.twitter.com/pagalvin

Quick and Easy: Debugging VS 2010 Solution Deployment

Visual Studio 2010 reports hard-to-debug errors during deployment some times.  A quick and easy way to do some very rough debugging is to throw your own named exceptions.  Visual Studio will show them in the output console.

Consider this bit of code:

image

If this feature is scoped to a web application, site will be null.  If you try and reference a property of site, you’ll get the ambiguous error:

Error occurred in deployment step ‘Add Solution’: Object reference not set to an instance of an object.

However, if throw a new Exception and pass a string to the constructor, you get a slightly more useful message:

image

It’s a crude technique, but pretty fast and easy.

</end>

Subscribe to my blog.

Follow me on Twitter at http://www.twitter.com/pagalvin

Timer Job FeatureActivated And Feature Scope

I’ve been working with some code that someone handed to me for a timer job.  He hadn’t provided the actual feature activation code so I had to write it, of course.  I took advantage of Andrew Connell’s famous blog post on the subject.

I’m using Visual Studio 2010 and deployment kept failing with an error “Error occurred in deployment step ‘Add Solution’: Object reference not set to an instance of an object.”

I was taking his code too literally.  I was scoping the feature to the web application level, as shown:

image

As a result, the properties that are sent to the receiver are from the web application, not a site collection.  In the end, the code looks like this:

public override void FeatureActivated(SPFeatureReceiverProperties properties)
{

    // Don’t do the following with web app scoped features, it leads to despair Smile
    // SPSite site = properties.Feature.Parent as SPSite;

    SPWebApplication wa = properties.Feature.Parent as SPWebApplication;

    if (wa == null) throw new Exception("webapp2 is null.");

    foreach (SPJobDefinition job in wa.JobDefinitions)
    {

        try
        {
            if (job.Name == List_JOB_NAME)

                job.Delete();
        }
        catch (Exception e)
        {
            throw new Exception("marker 2");
        } // catch exception e
    }

    // install the job

    WeatherForecastTimerJob weatherForecastTimerJob =
        new WeatherForecastTimerJob(List_JOB_NAME, wa);

    SPMinuteSchedule schedule = new SPMinuteSchedule();
    schedule.BeginSecond = 0;
    schedule.EndSecond = 59;
    schedule.Interval = 5;
    weatherForecastTimerJob.Schedule = schedule;
    weatherForecastTimerJob.Update();

}

The key take-away is that when the feature is scoped to a web app, the SPFeatureReceiverProperties that SharePoint passes to your feature receiver has web app level parameters.  Andrew’s old blog entry assumes it’s scoped to the site collection.

</end>

Subscribe to my blog.

Follow me on Twitter at http://www.twitter.com/pagalvin

CodePlex Project Update: SharePoint Designer Workflow Extensions

A while ago, I wrote that I was trying to resurrect my old CodePlex project, SharePoint Designer Workflow Extensions.  That CodePlex project was developed for WSS/MOSS and adds a handful of utility type functions, such as “ToLower()”, “ToUpper()”, “Substring()” and so forth.  It even has a general purpose “call web service” style function.  You can read more about it here: http://paulgalvinsoldblog.wordpress.com/2007/10/28/sharepoint-designer-custom-activity-to-execute-user-defined-c-functions/.

I more or less abandoned it quite a while ago.  Ever since SharePoint 2010 came out, however, I’ve been meaning to look back at it and make it work in SP 2010.  Well, today, I did just that.  I haven’t updated the code to CodePlex yet. I want to educate myself on CodePlex conventions before I do that, but I did update the home page wiki for the project.

The wider and more interesting implication is that custom activities from WSS and MOSS seem to port over pretty easily, which is a (welcome) surprise to me.

Here’s what it looks like in SharePoint Designer when it’s working:

image

</end>

Subscribe to my blog.

Follow me on Twitter at http://www.twitter.com/pagalvin

Where is Microsoft.SharePoint.ApplicationPages.Administration.dll?

I was handed a visual studio project that references Microsoft.SharePoint.ApplicationPages.Administration.dll.  It took me a little while to find it and I thought I’d share.  In my environment, it’s located at:

c:\program files\common files\microsoft shared\web server extensions\14\config\adminbin

</end>

Subscribe to my blog.

Follow me on Twitter at http://www.twitter.com/pagalvin

BrightStarr US Looking for SharePoint Analyst

My company, BrightStarr, is looking for a SharePoint business analyst.  Our goal is to work with someone who:

  • Understands the platform very well
  • Has a good idea of what’s a smart SharePoint solution versus a cobbled together house of cards
  • Enjoys working directly clients, some of whom understand what SharePoint is all about and some who have just a vague notion that SharePoint could help them but not sure exactly how
  • Can write very well
  • Can communicate really well with a small team
  • Is good at and enjoys multi-tasking.  This is not a heavily process-driven environment (we have enough process to do things in an organized way, but we’re extremely fast on our feet, nimble and all that good stuff).

This is not a developer position although if you’re a consultant-developer looking to focus more or consulting and less on development, this could be a good step for you.

If you’re interested, ping me on twitter or email me!

</end>

Subscribe to my blog.

Follow me on Twitter at http://www.twitter.com/pagalvin

Where is Microsoft.CSharp Anyway?

I was handed a .zip file with a moderately complex project structure and which had been ripped out of subversion.  The code is referencing Microsoft.CSharp, as in:

image

As you can see, visual studio was missing the actual DLL. 

I don’t normally think about where these things are physically located.  I dug around here, created a new console app (after following reading through this little exchange) and found the DLL on my environment at: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\Microsoft.CSharp.dll.

This actually gave rise to an issue with visual studio complaining that I was targeting the wrong environment, “Microsoft.CSharp.dll or one of its dependencies requires a later version of .NET blah blah blah”.  In the end, I remove the reference altogether and that seems to have solved the issue.

It’s just another one of those oddly difficult things to figure out and the sort of thing that is less interesting than an argument with your wife over whether there are too many women’s coats in the closet Smile

</end>

Subscribe to my blog.

Follow me on Twitter at http://www.twitter.com/pagalvin

Very Cool BrightStarr Video

Having just started working here at BrightStarr, I’m pretty psyched that we’ve put together this very cool video up on youtube here: http://www.youtube.com/user/BrightStarrSP

I wasn’t involved in producing it and I’m not personally big on these kinds of promotional efforts, but this one is quite cool to me.

Cool BrightStarr Video

</end>

Subscribe to my blog.

Follow me on Twitter at http://www.twitter.com/pagalvin

Goodbye CGS, Hello BrightStarr!

Tomorrow, I officially start my first day at BrightStarr (www.brightstarr.com), a UK based company with a US office that is, incredibly, a mere 6 miles from my house.

It was an easy decision to leave CGS, but a hard decision to make Smile.  Let me explain.

I joined CGS just over a year ago (December 2009) and joined as the Director of a SharePoint consulting practice.  This seemed like a brilliant idea at the time.  Here in the US at least, it’s quite common for people to start out as a junior dev type person, writing reports and tracking down annoying rounding error issues (I don’t miss those days at all!).  You gain increasing levels of responsibility and associated development awesomeness.  I had unbelievable opportunities over my career to some very cool stuff.  I got to write an invoicing system from scratch.  I got to work with smart people, including my brother of all people, to develop a complete web based development app for a 4GL called Progress.  Fun, fun times.

Of course, you progress from the Sr. Dev type to a technical team lead, bordering on being that most hallowed of technical things – an Architect.

The conventional wisdom on this progression is that the next step from Architect is to some kind of more senior management role.

I had bought into and accepted that progression.  When I joined CGS in one of those more senior roles, I anticipated, to some extent, that I’d be stepping “beyond” architect and into some kind of “super architect” kind of role – one architect to rule them all Smile

For me, that turned out to be less than successful.  It’s not to say that I didn’t have some good success in the role, but in the end, I’m not a classic practice manager.  Asking people on a weekly basis whether they have entered their time into the timesheet system just isn’t very interesting to me.  Scheduling out “resources” (or people, really) months in advance is just boring.  Pouring over SOWs and looking for and closing potential loopholes that may bit us in future is a real horror.  Yet, these are important things and given how important they were to the CGS role, it was obvious a change had to to be made. 

It was only obvious to me after a lot of thinking, however.  Thankfully, the evidence was clear enough to me that once I did really think about it, it became obvious. 

That got me to looking for open positions and I found BrightStarr.

I’ve signed on as a SharePoint architect and I can’t wait to get started.  So far, they are a very impressive crew and I think that they (we!) are poised to make a real name in the market.  I’ll be posting more about what I do there and I am really looking forward to it.  Have a look at their web site – www.brighstarr.com – it’s an impressive piece of work.

I consider myself very lucky in all of this.  We have all seen various mid to senior level managers who are sort of stuck in a mire, unable to really excel or move forward quick and with confidence.  That was where I was headed and I’m very glad to have escaped it so easily. 

</end>

Subscribe to my blog.

Follow me on Twitter at http://www.twitter.com/pagalvin