SharePoint MVP Chat on Wed 04/20

I’ll be participating in one of the period MVP chats next week, 04/20.  Here’s Microsoft’s write-up and link to the registration:

Do you have tough technical questions regarding SharePoint for which you’re seeking answers? Do you want to tap into the deep knowledge of the talented Microsoft Most Valuable Professionals? The SharePoint MVPs are the same people you see in the technical community as authors, speakers, user group leaders and answerers in the MSDN and TechNet forums. By popular demand, we have brought these experts together as a collective group to answer your questions live. So please join us and bring on the questions! This chat will cover WSS 3.0, MOSS, SharePoint Foundation 2010 and the SharePoint Server 2010. Topics include setup and administration, design, development and general question.
Please join us on Wednesday April 20th at 9am PDT/noon EST to chat with MVPs from around the world. Learn more and add these chats to your calendar by visiting the MSDN event page http://msdn.microsoft.com/en-us/events/aa497438.aspx

I joined in one of these last year and it was a real blast.  It’s just a crazy kind of open question/answer extravaganza. 

Here are some of the (currently) scheduled SharePoint MVP participants:

Cornelius van Dyk
Dan Attis
Daniel Wessels
David Martos
Ivan Sanders
Jeremy Thake
John Ross
Kris Wagner
Mike Oryszak
Randy Drisgill
Woody  Windischman
Zlatan Dzinic

That’s a wide spectrum of interests and specialties.  I think this will be a fun time and good use of your lunch hour (or any hour during the day Smile )

Sign here here (http://msdn.microsoft.com/en-us/events/aa497438.aspx).

</end>

Subscribe to my blog.

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

One Reason for “One or more field types are not installed properly”

I was making a small tweak yesterday to a web part that does a CAML query against a list.  I made the change, deployed it and got hit with an error:

An unexpected error has occurred in the Three Day Outlook Weather Forecast WebPart. Please contact the system administrator. One or more field types are not installed properly. Go to the list settings page to delete these fields.

I was facing another oddball issue earlier so I didn’t immediately connect my CAML query with the error that SharePoint was reporting to me.  I did a quick bing search and and found this helpful blog post by Sandeep Nahta  (http://snahta.blogspot.com/2009/01/one-or-more-field-types-are-not.html).

Here is the bad query:

query.Query += "<Where><And><Neq><FieldRef Name=’Abbr’/><Value Type=’Text’>SFNY</Value><FieldRef Name=’Abbr’/><Value Type=’Text’>SFIS</Value></Neq></And></Where>";

Here it is fixed:

query.Query += "<Where><And><Neq><FieldRef Name=’Abbr’/><Value Type=’Text’>SFNY</Value></Neq><Neq><FieldRef Name=’Abbr’/><Value Type=’Text’>SFIS</Value></Neq></And></Where>";

So, the moral of the story is: make sure your CAML is correct or you may get an oddball error.

Subscribe to my blog.

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

</end>

Quick Fix For “There has been an error while loading the form”

I’m testing a custom SharePoint Designer 2010 activity this fine Sunday afternoon and I was unexpectedly hitting a “Critical Error” when trying to launch the workflow:

There has been an error while loading the form.

Click Start Over to load a new copy of the form.  If this error persists, contact the support team for the Web Site.

Click Close to exit this message.

Show error details

Of course, if you click the “Show error details” button all it does is show you a correlation ID:

image

In my case, this turned out to be an Alternate Access Mappings problem.  I looked at the log file in the 14 hive and saw that InfoPath was complaining about an AAM issue (since I was hitting localhost instead of the server name).  I changed my URL and that solved it.

It does to show that with all the linkings of the various bits now in SP 2010, the thing you naturally this is a problem (SharePoint Designer workflow in my case) is actually totally unrelated to the core problem.

Subscribe to my blog.

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

</end>

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