Sandrino Di Mattia

Content-type: Microsoft

Social

Follow me on Twitter! LinkedIn! RSS! SilverlightShow Contributor

Recent posts

Tags

Categories

Archive

Blogroll

SharePoint 2010 Ribbon customizations not working as expected

Customizing the SharePoint 2010 isn't a walk in the park. Working with the XML files using CustomActions, CommandUIExtensions, CommandUIDefinitions, ... can get a little annoying after a while, especially if you're re-deploying your feature after each change.

While customizing the ribbon today I encountered a very frustrating problem with the ribbon customizations. For each change I made in the Elements.xml and deployed to SharePoint it was as if I didn't change a thing. After numerous attempts I even decided to throw away my customizations and use some I found on the web (from Chris O'Brien) for example.

Even this didn't help and this is where I got suspicious of my environment. As I was using the following code I thought it could have something to do with my issues:

  SPRibbon ribbon = SPRibbon.GetCurrent(this.Page);
  ribbon.MakeTabAvailable("Sandrino.Ribbon.Tab");

Before the next deployment I changed the ID of the tab (both in the Elements.xml and the MakeTabAvailable method) and there it did work. So it seemed only the first deployment for that tab ID worked correctly.

After a long search it seemed the reason was that I didn't update the feature version. Feat ure version didn't exist in SharePoint 2007 but this is a new concept in SharePoint 2010. Jeremy Thake has a great webcast that explains the "why and how" of feature versioning in a webcast.

So finally, to get the ribbon to work correctly after changing something you need to update the version of your feature. This is easy to do in Visual Studio 2010, just open the feature and go to the properties window.

Voila. Redeploy the feature and this time you will see your changes!

In the end this has something to do with how the customizations are cached and how your browser picks them up. When you're in the process of customizing the Ribbon and you don't want to change the version each time you want to test something, just try the following:

By right clicking the IE icon you can start InPrivate browsing, which starts a clean IE instance without cookies, cache, ...  And this will also make sure you get the latest ribbon version while you're testing.

Enjoy...

Posted: Mar 10 2011, 15:48 by Sandrino | Comments (2) RSS comment feed |
Filed under: SharePoint

SharePoint 2010 BdcException: The shim execution failed unexpectedly - Proxy creation failed. Default context not found..

When you're working with the Business Connectivity Services outside of SharePoint 2010 you might stumble upon the following problem:

Microsoft.BusinessData.Infrastructure.BdcException: The shim execution failed unexpectedly - Proxy creation failed. Default context not found..
 ---> Microsoft.Office.SecureStoreService.Server.SecureStoreServiceException: Proxy creation failed. Default context not found.

This is caused by the fact that there is no default SPServiceContext, meaning SPServiceContext.Current is always null. The problem is that, for example, when you are working with methods like IEntity.FindFiltered you need a current context, since the underlying code will use SPServiceContext.Current

To solve this issue you can create a code block that will fill the current SPServiceContext:

using (var site = new SPSite("http://localhost"))
{
    // Get context for the site.
    var context = SPServiceContext.GetContext(site);    
            
    // Assign context in SPServiceContext.Current
    using (var scope = new SPServiceContextScope(context))
    {
        ...
        entity.FindFiltered(...);
    }            
}

After closing the using codeblock your current SPServiceContext will be empty again.

Enjoy

Posted: Feb 24 2011, 13:29 by Sandrino | Comments (0) RSS comment feed |
Filed under: SharePoint

New SharePoint 2010 Exams Available in July

Exams

In the last MCP flash Microsoft announced the availability of SharePoint 2010 Exams:

These exams will be available July 12th.

Resources

To study for the exams you'll need books.
But the only decent book (already available) I found was Beginning SharePoint 2010 Administration: Windows SharePoint Foundation 2010 and Microsoft SharePoint Server 2010.

Aside from that book you'll want to get  a Safari Books Online subscription.
They offer "Rough Cuts" of books still in development and also online video courses.

There are also the free online videos:

And finally there's the community. Blogs, community sites, CodePlex, ...
This is also a great resource to get acquainted to SharePoint.

Enough material to start with your preparations!

Posted: Jun 18 2010, 09:35 by Sandrino | Comments (0) RSS comment feed |
Filed under: SharePoint

Virtual machines with the latest Microsoft technology stack: 2010 IW Demo VM

Last week Microsoft released the following 18GB download containing 2 virtual machines: http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=751fa0d1-356c-4002-9c60-d539896c66ce

Virtual machine “a” contains the following pre-configured software:

  1. Windows Server 2008 R2 Standard Evaluation Edition x64, running as an Active Directory Domain Controller for the “CONTOSO.COM” domain with DNS and WINS
  2. Microsoft SQL Server 2008 R2 Enterprise Edition with Analysis, Notification, and Reporting Services
  3. Microsoft Office Communication Server 2007 R2
  4. Microsoft Visual Studio 2010
  5. Microsoft SharePoint Server 2010 Enterprise Edition
  6. Microsoft Office Web Applications
  7. Microsoft FAST Search for SharePoint 2010
  8. Microsoft Project Server 2010
  9. Microsoft Office Professional Plus 2010
  10. Microsoft Visio 2010
  11. Microsoft Project 2010
  12. Microsoft Office Communicator 2007 R2

Virtual machine “b” contains the following pre-configured software:

  1. Windows Server 2008 R2 Standard Evaluation Edition x64, joined to the “CONTOSO.COM” domain
  2. Microsoft Exchange Server 2010

And finally there's also the file Virtual Machine Setup Guide.docx containing all the required information on the virtual machines.
This will be the perfect playground to test all new technologies...

Since this is a pretty heavy download with 30 files you'll want to automate this.
This can be done with the following cURL script:

Download the script: IWVM_Download.zip (373.00 bytes)
Download cURL: http://curl.download.nextag.com/download/curl-7.19.5-win32-nossl.zip

And the script in action:

Enjoy

Update:

An add-on for Project 2010 was also released by Microsoft, it's a separate download that can be combined with the virtual machines:

Project 2010 Demonstration and Evaluation Installation Pack helps you to evaluate and demonstrate the full power of Project 2010. It is an add-on for the "2010 Information Worker Demonstration and Evaluation Virtual Machine" that has to be downloaded, configured and up and running before installing this pack.

Did you know... Microsoft Chopsticks?

This morning I accidentally arrived on this site: http://www.microsoft.com/belux/msdn/nl/chopsticks/
It contains great content for and by the Belgian developer community.

Videos include:

I must say this looks like a local version of those Silverlight Snacks, great!