Sharepoint 2010 sites not showing in SharePoint Admin – restart the services

I have had two odd SharePoint 2010 issues this week.

The first issue was suddenly the Admin console stopped working.  This was annoying but luckily it was part of a load balance SharePoint and there was another server I could use to access the SharePoint admin console.

I tried stopping the SharePoint services and it got itself in such a state that it got stuck stopping.  So in the end I did a magic reboot (after taking it out of the load balancer) and this magically fixed.

I then also had another problem on another SharePoint server were it wasn’t showing all the sites and when calls were coming to the SharePoint site which was using sites it wasn’t displaying it in.

I couldn’t really find many errors so I took it out of the load balancer and then tried to restart the SharePoint timer service and it got stuck stopping.  In the end I had to stop the service more forcefully and then when it started I could see the missing sites.

I thought it was an odd occurrence for SharePoint to not show some sites but to also not really throw any errors.

but a good old Services restart saved the day, which is one step away from a server reboot.

CRM 2011 – Could not load file or assembly ‘Microsoft.SharePoint.Client, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c’ or one of its dependencies. The system cannot find the file specified.

continueing with my current project of trying to automatically create Sharepoint folders and copy files into sharepoint.

I have now done this with a webservice and a web application.  I was getting this error when I published the web application to the live server, the code was working on my local dev environment.

This time I was coding the web application and when it got to the point of trying to connect to sharepoint it was throwing this error

Could not load file or assembly ‘Microsoft.SharePoint.Client, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c’ or one of its dependencies. The system cannot find the file specified.

The key to this error (in my opinion) was the fact it could not find the file.  This basically seemed to say it could not find Microsoft.SharePoint.Client.dll

This seemed a bit odd because I had added the dll as a reference but looking in the bin directory of the deployed web application.

This other time I have had an error similar to this is when I have tried to run the CRM plugin registration tool and the folder hasn’t got the microsoft.crm.sdk.dll and maybe a couple of other dl’s.

So once I copied the sharepoint dll’s into the bin directory of my web application it was working

CRM 2011 – Transactions and Sharepoint Online

I have previously blogged about using authentication with sharepoint online and I am at it again.

https://crmbusiness.wordpress.com/2012/06/20/crm-2011-authenticating-with-sharepoint-online-2010-from-a-net/

To summarise the blog above you basically have to login to Sharepoint online before you can create the folders and this involves logging on to Office365.  The code checks to see if there any cookies which would have been created if you had logged on and if there aren’t any it logs on and creates those cookies (if I remember correctly).

This caused me some problems when trying to use this code within a CRM plugin.  Firstly I was getting problems because some of my code was a USING statement, I have a couple of good blogs, web pages below.

http://stackoverflow.com/questions/248961/c-sharp-using-statement-catch-error

http://msdn.microsoft.com/en-us/library/aa355056.aspx

The main reason this doesn’t work in a plugin is because I think it creates another transaction and this breaks the plugin transaction.

I’m not totally sure about this transaction below but it’s what I think is happening.

I think CRM plugins are based around WCF which is a transactional and my understanding of this is you can’t have a transaction within a transaction.

I had written some code which creates some sharepoint folders based on the document locations records, basically when a project record was being created I wanted to create the sharepoint folder and some other folders within that folder.

I tested the code working from my machine and manually created a an IOrganizationService and getting/retrieving and creating CRM entities etc.  This code also worked and created the sharepoint folders.

BUT…

when I then put this into a plugin I was getting transaction errors, this was difficult to debug but when I tried to connect to Sharepoint online it crashed out with a transaction error.

To get round this I decided to put the code into a webservice and call that from my plugin and this finally worked.

I could be wrong about transactions and there could be a better way to do this but I’m just happy I got the thing working

CRM 2011 – Understanding document locations

I have been working with CRM 2011 and Sharepoint online.  Out of the box CRM 2011 has some great integration with Sharepoint and it can create and view folders semi automatically.

The current project wanted this to be automatic.

The first thing I had to do was understand how this worked and it’s a little bit unusual.  Sharepoint integration works in a similar fashion to email in CRM basically CRM doesn’t not do any sharepoint integration in a similar way to CRM does not do any emailing.

Emailing in CRM is passed off to either the Outlook add on or a CRM router.

My understand of Sharepoint and CRM is similar.

CRM creates entities called Document Locations and these hold relative sharepoint url information.  When you click on Documents in the left hand navigation options it creates a series of relative document locations, working back from the Sharepoint site entity.

e.g. for a new account called Test

Sharepoint site = default

document location – account

document location – Test

The two document locations will have a parent site or location link in them.

The way to understand this is to basically think of a file a structure on your C drive and imagine the default collection is not a sharepoint site but C:\

C:\account\Test

so to automate this for a new account I would need to add two new document locations account and Test.

I was doing this for a custom entity called project and the user could add lots of projects

c:\project\proj1

c:\project\proj2

c:\project\proj3

so when I was create a document location for project I had to check to see if a project had been created before, if it had then I knew the project document location was already created and I could then use that and reference it in the Parent Site or Location field.

Now I get onto the fact the point Sharepoint isn’t really related in CRM because even though I can create the document location records this does absolutely nothing in Sharepoint.  All it does it create a link to where it should be in Sharepoint but doesn’t create the actual folders.

There is also nothing in the CRM SDK to create Sharepoint folders from my understanding you now have to write code using the SharePoint dll’s or SharePoint webservice.

This is quite frustrating because CRM does create the sharepoint folder if you click on documents.

 

CRM 2011 – authenticating with Sharepoint Online 2010 from a .NET

I was having a struggle to authenticate with Sharepoint Online

I was using the Client Object Model and when I was trying to create a connection to sharepoint so I could check if folders had been added for CRM but I was getting a 403 forbidden message.

In the back of mind I was thinking the problem had to be linked to SharePoint/Office 365 online which both need you to login.

This page has a good overall description of the problem, you basically need to authenticate before you can start using SharePoint 2010 Online

Remote Authentication in SharePoint Online Using Claims-Based Authentication

http://msdn.microsoft.com/en-us/library/hh147177.aspx

The only problem with code I got from here is it popped up a login if the authenticated cookies were not on the machine.  As my code would be running from a plugin I needed to automate that

Authentication with SharePoint Online and the Client Side Object Model

http://blogs.msdn.com/b/cjohnson/archive/2011/05/03/authentication-with-sharepoint-online-and-the-client-side-object-model.aspx

this code works

Part 2: “Headless” Authentication with SharePoint Online and the Client Side Object Model

http://blogs.msdn.com/b/cjohnson/archive/2011/05/14/part-2-headless-authentication-with-sharepoint-online-and-the-client-side-object-model.aspx

one gotcha to mention with the code above is you have to put on the forward slash at the end of the SharePoint url

e.g.

https://<companyname&gt;.sharepoint.com/

if you don’t put the forward slash on it won’t work.

I also had problems because my pc clock was over 5 minutes out, it wasn’t letting me login.

some other useful links regarding writing .Net code for SharePoint 2010

Common Programming Tasks in the Managed Client Object Model

http://msdn.microsoft.com/en-us/library/ee537013.aspx

CRM 2011 and Sharepoint Integration

Well studying for the CRM 2011 installation exam I have got onto the area of SharePoint.

CRM 2011 brought some great improvements with some integration with SharePoint.

The course I am studying says the following SharePoint editions is required

  • Microsoft SharePoint 2010 (all editions)
  • Microsoft Office SharePoint Server (MOSS) 2007
  • Windows SharePoint Services 3.0

If you are integrating not with SharePoint 2010 then you have to create the folders in SharePoint and they are just displayed in CRM 2011 but if you integrate with SharePoint 2010 then CRM 2011 can create folders in SharePoint.

I haven’t tried integrating with older SharePoint version and quite frankly I hope don’t have to, my knowledge of SharePoint is rather murky and it usually takes me ages to work out how to do anything with it.

For those of you who have integrated CRM 2011 with SharePoint 2010 you will have had to run a script to get the SharePoint Grid working.  The notes for this say if it isn’t installed then SharePoint data will appear in an IFrame, which is the way the data is displayed in older versions of SharePoint.

CRM 2011 works with Sharepoint online

This blog from the Microsoft Dynamics CRM 2011 team has released some good news, Microsoft have or soon will have finally fixed the problems between Sharepoint and CRM 2011.

The problem was sharepoint online didn’t work with CRM 2011, the rough reason was Sharepoint online didn’t let you run a script which was need to allow the Sharepoint list component to be embedded in CRM 2011.

but after reading this blog post it seems this is now fixed.

You will need to download the  Microsoft Dynamics CRM 2011 List Component and your Microsoft Dynamics CRM administrator must install it.  Although I’m not entirely sure this is correct because you have to do this on Sharepoint administrator to apply the script, so if you are a CRM admin you probably won’t have enough privileges.

There are detailed instructions are here on how to install the correct files to get Sharepoint Online working with CRM 2011 online.

This is great news for Microsoft and all the users who have CRM 2011 and SharePoint online, which is propbably most people who have signed up for Office 365.

Well done Microsoft, better late than never.

 

CRM 2011 – Does CRM 2011 work with Sharepoint Online?

Well the honest answer to this question is – I wish I knew.

I have been searching for a definitive answer for about one hour now and my gut feeling is it doesn’t work.

I tried to set this up today and it almost works.  We have created the Sharepoint site and the entity directories have been added.  You can even see the files in the folder, I just can’t add any files using the buttons on the page.  Instead I get this error

 

It is very difficult to find out what is going on and any official information about this because a lot of the discussions are on forums it’s difficult to know if the information is up to date and accurate.

When Office 365 was released I remember reading an article stating Sharepoint 2010 didn’t work so I wondered if this had changed.

firstly I read this forum

http://social.technet.microsoft.com/Forums/en-AU/onlineservicessharepoint/thread/e6fbe54f-0b4b-40bf-952e-24f1aca09b54

I also read Richard Knudson’s blog, which I found quite amusing and displayed the highs and lows you can get with CRM

http://www.dynamicscrmtrickbag.com/2011/06/02/office-365-and-crm-online-better-together/

finally and for me I think fundamently, I found this forum post on the office 365 site

http://community.office365.com/en-us/f/154/p/2301/33070.aspx#33070

 

this sums up the problem succinctly, basically the current solution for Sharepoint involves making a change which effects all of Sharepoint and these application type changes cannot be made to Sharepoint or CRM in the cloud.

The problem with CRM integration is that a .htc file is required to enable the CRM web parts which allow you to connect to sharepoint document libraries from within the CRM online interface.  At this point, .htc file extensions are not allowed in sharepoint online and they are blocked by the strict browser file handling setting at the web application level.

I believe tenants are unique at the site collection level so changing these settings per tenant is not available (this has not been confirmed by MS)  Basically what this means is full CRM integration is not available even though they claim it is available.

In addition to the HTC problem, there are sign in issues between the two authentication providers.  While it has been stated MS will provide a fix for single-sign-on in Q4 2011, they have not said they will fix the allowed extensions nor browser file handling.

Therefore, the claim “CRM Online delivers a seamless end-user experience for end-users of Office 365” is a lie.

Where that leaves us…you can integrate fully with Sharepoint 2010 on-premises but not fully with Sharepoint Online.

 

The other key piece of information is this might be fixed by Q4 in 2011, which I assume is the UK Q4 because it seems to indicate it will be fixed in 2011.

I haven’t heard any information about when this will actually be fixed or if it’s close, if anyone knows any information on this please leave a comment.

On the plus side Sharepoint online is a really great resource for Microsoft partners, you get lots of free licences and don’t need a Sharepoint server.

 

 

CRM 2011 – How to get SharePoint 2010 dll’s into the GAC

I had a problem today, the plugin I had developed used a SharePoint 2010 dll which I needed to use.  For those of you who know about plugin development you  know any dll’s you need to access need to be in the GAC (although I think there is a tool which can combine dll’s but I haven’t used that yet).  

The problem I had was when I tried to copy the two SharePoint 2010 dll’s in the GAC, I got a permissions problem.  I could have done this with the gacutil but I didn’t have visual studio installed on the server.

I then found there is a useful SharePoint client install which basically installs the two SharePoint dll’s into the GAC for you and saves you a lot of hassle.

You can get the EXE by clicking on the link below

SharePoint Foundation 2010 Client Object Model Redistributable

Brief Description


This is a redistributable package of the Microsoft Silverlight and Microsoft .NET managed client object models in Microsoft SharePoint Foundation 2010, intended for use by developers.

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=b4579045-b183-4ed4-bf61-dc2f0deabe47

one day left of free Sharepoint 2010 training

There is one day left of the free Sharepoint training

All you have to do is register and the training is free

http://blogs.msdn.com/b/ukisvdev/archive/2011/02/10/free-three-days-of-online-sharepoint-2010-developer-training-march-14th-to-16th.aspx

it looks to have some interesting topics, day 3 has some information about web services and workflows

Day 3 (Live Meeting 3 hours) 1:30 – 4:30
•         Client Object Model: The Client OM can be accessed via web services, via a client (JavaScript) API, and via REST
•         Accessing External Data: Business Connectivity Services (BCS) enables integration with back end systems
•         Workflow: A powerful mechanism to create functionality using Windows Workflow Foundation