PerformancePoint 2010 Dashboard Designer – ‘An unexpected system error has occurred’ when adding a data connection

16 04 2010

Whilst trying to setup a PerformancePoint 2010 dashboard on my SharePoint 2010 boot to vhd environment today I received this error message – ‘An unexpected system error has occured’…’ when adding a data connection in the Dashboard Designer.

A couple of Google searches didn’t turn up much but did point me towards the ‘Secure Store Service’ – this can be found in Central Administration > Manage Service Applications.

The service was started but when I tried to manage the service I received another error stating that the service was not responding!

It was then that I realised – the environment in question did not contain the pre-requisite WCF hotfix which is required for SharePoint 2010 to install on Windows Server 2008 R2. This machine had actually been been upgraded from Windows Server 2008 x64 to Server 2008 R2 x64 (this was the SharePoint Information Worker VHD) therefore the hotfix did not exist.

I was worried I would have to re-install SharePoint after installing the hotfix but it turns out you don’t need to, just follow the steps below –

  1. Download the Windows Server 2008 R2 WCF hotfix (there are two versions of this patch and the latest is version 2 – ‘Windows6.1-KB976462-v2-x64.msu’), get it from here – KB976462
  2. Install the hotfix and reboot the machine
  3. Run the SharePoint Products and Technologies configuration wizard – PSCONFIG
  4. Proceed through the wizard and it will upgrade your SharePoint farm
  5. Check in Central Administration and you should now be able to successfully manage the ‘Secure Store Service’ and Dashboard Designer should work!!

Hope this helps 🙂





SharePoint Feature Receiver Error ‘The EXECUTE permission was denied…’

15 03 2010

I got this error this morning when trying to activate a web feature in a site collection. It turns out that this is because the application pool running the web application (in my case ‘Network Service’) does not have the required permissions to run some SharePoint SQL stored procedures within the configuration database.

In order to fix this error you will need to give the application pool database role WSS_Content_Application_Pools ‘Execute’ rights on the following stored procedures:

  1. proc_PutObject
  2. proc_putClass
  3. proc_dropObject
  4. proc_getNewObjects

Once you have granted this role the correct permissions you will be able to activate the feature/perform the operation you were attempting before.

Hope this helps!





Boot to VHD with the SharePoint Information Worker VHD (For those with 4GB of RAM or less)

6 03 2010

Before I begin I want to say thank you to a few people who helped me to get this working, through their blog posts and messages on twitter – @brianlala @joeloleson @LoungeFlyZ.

As I’m sure most of you are aware – the launch date for SharePoint 2010 has now been announced as May 12th. So what better time to start looking at SharePoint 2010.

Brian has already posted a guide on his blog that details most of the steps required to get this working –

http://spinsiders.com/brianlala/2010/02/03/high-level-steps-to-sp2010-demo-vhd-boot-joy/

I will cover some additional steps that aren’t mention and also what’s required to shrink the VHD and convert it to a fixed size. Whilst the VHD itself is only around 40gb in size – it has been set to dynamically expand and the OS partition is set at 130gb. This means that to boot from it you will need at least 130gb free on your hard drive as when the VHD is booted for some reason it needs to expand to its full size, see this post for more info –

http://codebetter.com/blogs/howard.dierking/archive/2009/08/08/windows-7-boot-from-vhd-a-few-gotchas.aspx

If you do not resize the VHD and don’t have the required space for it to expand then you will get a Blue Screen of Death (BSOD) when booting.

I will also cover in this guide the process of injecting your hard disk controller driver into the VHD. Brian covers this in his guide but I have some tips for this which I will share.

For those of you that weren’t aware, Microsoft have provided a SharePoint 2010 VHD for download entitled the ‘SharePoint Information Worker VHD’. This download actually contains two VHD’s – the second of which acts as as a mail server (this one will not be covered in this guide).

The first VHD contains SharePoint 2010 Beta, Visual Studio 2010 Beta, Office 2010 ‘Mondo’ and most apps you will need. The machine is setup as a domain controller of the ‘Contoso’ domain and is pre-populated with about 200 or so AD users. Various SharePoint sites have already been setup too.

Whilst I think the VHD’s provided by Microsoft are great they are not setup to be booted from. I only have 4gb of RAM in my laptop so boot to VHD was really the only option if I wanted to run this machine.

Part 1 – Resizing/Cloning the VM

1. Un-install Office 2010 ‘Mondo’ from the machine, if you don’t do this you will not be able to remove it again and will most likely be stuck with a 1722 error each time you launch an office application.

2. Follow the steps on Brian’s blog post to upgrade the OS within the VHD to Windows Server 2008 R2. You will need run the domainprep tool with the /forestprep and /adprep command line switches first.

3. Now you need to resize the 130gb partition to something more manageable. So download a copy of the GParted live CD and boot from it. Once you are at the GParted interface select the partition and resize it down to a sensible size – I chose 60gb. You will need to click resize and then apply.

4. Once GParted has finished – reboot the VM and let the chkdsk run if it wants to check the consistency of the disk. If you have a look in disk management now you will see that the partition has been resized but we are now left with a lot of unallocated space – this needs to be removed before we can boot to the VHD.

5. Shutdown the VM and create a new fixed size virtual hard disk, you will need to make sure it is slightly bigger than the size you chose earlier when resizing the partition. I chose 63gb for the size of my new virtual disk.

6. Attach the newly created hard disk file to the VM.

7. Now we need to clone the contents of the original hard disk onto the newly created one. There are a number of software options out there to do this – one in particular being Norton Ghost but this costs money. I found that Clonezilla which is free and open source does the job perfectly – http://clonezilla.org/. Download the live CD and boot the VM from it.

8. Follow the steps in the Clonezilla interface using beginner mode to clone the contents of hard disk 1 to hard disk 2.

9. Once Clonezilla has finished power off the VM and remove the original hard disk.

10. Power on the VM and make sure it boots correctly, if it fails check the troubleshooting section at the bottom of this post.

Part 2 – Configuring it to Boot

Before we can copy the virtual hard disk (VHD) file over to our client machine ready for booting we need to either inject the hard disk controller drives and modify the registry. If we don’t do this then we will most likely get a BSOD when we try to boot from the VHD.

I’m afraid that I am not going to go into a great level of detail here but will point out the steps that helped me and allowed me to get the VHD to boot.

1. Open the registry editor on the client machine (the machine you want to boot the VHD from) and navigate to HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > services. This key contains all the drivers/services that windows loads when it boots.

2. Navigate to the same key on the VM, what you will need to do now is go through each of the sub-keys in the services key and compare each one’s ‘Start’ value. A value of 3 indicates that it will start when windows is boot and 0 indicates that it will not . Rather than go through each key, check ones which are most likely to be hard disk controllers e.g. ‘atapi,intelide’ etc.

Depending on your SATA/IDE controller it may not just be a case of editing these registry entries – you might need to copy the drivers to the VM and add registry entries for these drivers but I’m afraid I’m not going to cover that here.

3. THIS IS WHAT WORKED FOR ME – In my case I simply set the start value of the ‘msahci’ (SCSI Controller) to 0, this was set to start on the VM and I guess most likely because of the hardware that Hyper-V uses. Try this before attempting the above.

**Please note that once you have made these changes the VHD might not boot again in Hyper-V so you may wish to make a backup!**

Part 3 – Booting from the VHD

Once you think you are ready to boot from the VHD, copy the VHD file to your client machine and add an entry to the boot menu as described here –

http://technet.microsoft.com/en-us/library/dd799299%28WS.10%29.aspx

When you reboot your machine you will see a new option in the boot menu to boot into your SharePoint Information Worker VHD. If all has gone well then it will boot and you can then begin to install the drivers for your hardware.

Hope this helps someone – think this has been my longest blog post yet!! 🙂

**Troubleshooting

If for any reason the VM does not boot and you get this error message –

‘The boot selection failed because a required device is inaccessible’

Try these steps to fix it (I received the error after using GParted to resize the disk) –

1.Boot from the Windows CD you used to upgrade the VM

2. Select the ‘Repair My Computer’ option

3. Open the command prompt and type ‘bootrec /scanos’ – hopefully you will see the windows install

4. Now type ‘bootrec /rebuildbcd’ and select the windows install – this will add it back to the BCD boot menu.

5. Reboot the VM – hopefully it works!





Getting field values of an SPListItem returned from an SPQuery – watch out!

16 02 2010

I have seen and read about this gotcha before but even so I still fell for it today and it took for a couple of hours to figure out so I’ve decided to blog about it.

If you are working with SharePoint items in code which you have returned using a CAML query then you should always populate the SPQuery instance’s ViewFields property. You must include in here all the fields for which you might need to get the value of later. Failure to do this will mean the returned SPListItem instances might not contain the data for certain fields and will throw an exception (usually ‘Value was not within the expected range’).

The ViewFields property is set like this:


    <fieldref name="Title" /><fieldref name="Created" /><fieldref name="ID" />

    

You can then access a fields value on an SPListItem instance using the normal code:


    SPListItem item = list.GetItemById(1);

    string Title = item["Title"].ToString();

    

Hope this helps!!





Removing a Custom Nintex Action

11 02 2010

Today I needed to remove a Nintex custom action that I had produced from my SharePoint environment and couldn’t see any options to do this on the ‘Manage Allowed Actions’ page in Central Admin . A quick Google (errm I mean Bing!) search revealed a forum thread at the Nintex connect website, the forum thread mentioned going into the database to remove the action.

I didn’t fancy doing anything that drastic! so I did some more searching and then I found out that there is actually a command line tool called ‘Naming.exe’ which is supplied with Nintex Workflow 2007 and resides in the following folder:

C:\Program Files (x86)\Nintex\Nintex Workflow 2007\

This tool is similar to STSADM and allows you to remove a custom action. To remove an action use the following command:

NWAdmin.exe –o RemoveAction

You need to give this command the namespace and type name of your adapter. After this command has run you will need to execute another command:

NWAdmin.exe –o RemoveSafeActions

This command will remove the references to the action assembly from the web.config files of your SharePoint sites.

Hope this helps!





Debugging SharePoint code when using PowerShell

10 02 2010

Note to self and anyone else who is interested –

When trying to debug code – a FeatureReceiver in my case with Visual Studio when you are using PowerShell to actually kick off the event you need to ‘powershell.exe’ process in addition to the normal w3wp worker processes. If you don’t do this then your breakpoints won’t get hit it seems.

Hope this helps someone!





SharePoint, AJAX UpdatePanel and SPWebPartManager woes

26 01 2010

If you are having trouble getting your AJAX UpdatePanel to update properly in a SharePoint page or Web Part then you have come to the right place. You may already be aware that to get an UpdatePanel working in SharePoint you need to add a an additional function to your code that alters the _spFormOnSubmitWrapper and the _spSuppressFormOnSubmitWrapper. See here for an example –

http://petesullivan.wordpress.com/2008/06/13/ajax-update-panels-and-sharepoint/

However!! If you are using a custom Master Page then watch out because there is another gotcha!

It seems that if the SPWebPartManager tag appears before the Form tag in your master page then your updatepanel will not update properly and most likely won’t display any content. This should be changed so the SPWebPartManager tag appears underneath the form tag, see below for an example –

Incorrect

<WebPartPages:SPWebPartManager ID="SPWebPartManager1" runat="server"/>   
<form id="Form1" runat="server" onsubmit="return _spFormOnSubmitWrapper();">

Correct

<form id="Form1" runat="server" onsubmit="return _spFormOnSubmitWrapper();">
<WebPartPages:SPWebPartManager ID="SPWebPartManager1" runat="server"/>

Hope this helps! 🙂





Creating Custom SharePoint Web Part Connections

25 01 2010

I created my first web part connection the other day and was surprised at how easy and effective it was. I thought I would walk through the process that is required to connect two custom web parts together.

In this brief tutorial I am not going to cover how to create a web part or how to deploy one. I will assume that you (the reader) already knows how to do this. All code in this tutorial will be written in C#.

1. To begin create yourself two web parts – one of these will be the ‘Provider’ and the other the ‘Consumer’. You can create these however you like either using the VseWSS extensions or perhaps in an empty class library project.

2. Create an interface similar to the one below –

 public interface IExampleProvider
 {
        String TestParam { get; }
  
 }

Inside this interface you should define any parameters that you wish to send to your ‘Consumer’ web part.

3. In your Provider web part ensure that it implements the interface you have just created –

 public class ProviderWebPart: WebPart, IGovernanceProvider
 {
 }

4. Next create a property that returns the interface and decorate it with the  ConnectionProvider attribute. The parameters of  are the display name and the real name (ID) of the connection.

 [ConnectionProvider(&quot;Test Parameter&quot;,&quot;ExampleID&quot;, AllowsMultipleConnections=true)]
 public IExampleProvider GetExampleProvider()
 {
    return this;
 }

5. Finally for the Provider web part you need to ensure that the parameter property from your interface is implemented –

protected string _TestParam = &quot;&quot;; 
public string TestParam 
{
 get { return _TestParam; } 
}

6. Now its time to setup the Consumer web part, in your consumer web part class define a method that will accept the interface as a parameter and decorate it with the ConnectionConsumer attribute.

private IExampleProvider exampleProvider;
[ConnectionConsumer(&quot;Site URL&quot;)]
public void RegisterProvider(IExampleProvider provider)
{
   this.exampleProvider = provider;
}

7. You can now retrieve the value/values that have been sent to the consumer web part by calling the properties of the exampleProvider. Note you should check if a connection has been made first by seeing if the exampleProvider is null.

string myParam = this.exampleProvider.TestParam;

8. Deploy your two web parts by whatever method you wish, when you add the web parts to the page and click the ‘edit’ dropdown you should see a new menu option called ‘Connections’. The menu will appear on both the provider and consumer web parts but you only need to configure one.

Consumer Web Part:

image

Provider Web Part:

image

9. You are finished!

I hope you enjoyed this brief tutorial into web part connections, if you have any questions then feel free to leave a comment!

Hope this helps 🙂





I have my first MCTS!

12 01 2010

Just a quick post to say that I passed my first SharePoint exam last week (70-631 TS: Windows SharePoint Services 3.0, Configuring). For those of you that haven’t taken it yet, its a very simple exam for those with a few years of Decent SharePoint/WSS experience.

I am planning on taking my next exam (70-541 TS: Windows SharePoint Services 3.0 – Application Development C#) at the end of January so fingers crossed! For this exam I am brushing up my skills by reading the ‘Inside Windows SharePoint Services 3.0’ book by Ted Pattison.





Applying SharePoint theme ‘Write error on file “/_themes/yourtheme” error

6 01 2010

I recently went to apply a custom SharePoint theme and was presented with the unhelpful error message above.

It turns out that the reason for this error is that SharePoint has encountered an unknown file that it cannot read from in the themes’ directory.

Navigation to your custom theme directory  – [Systemdrive]\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\THEMES\yourtheme and delete the rogue file.

In my case it was the windows generated ‘thumbs.db’ thumbnail database in the folder that was causing the problem. If you have used an editor to edit any of your theme files then you may possibly have some temp files in the directory which need deleting.

If like me it was the ‘thumbs.db’ file then be sure to disable thumbnail caching for the folder. To do this click Tools in windows explorer then select Folder Options > View, look for the checkbox entitled ‘Do not cache thumbnails’ and click it.

Hope this helps 🙂