The SharePoint CSOM assemblies and the “The specified module could not be found” error

When working on my community project SharePoint Client Browser I received multiple times the issue which related to the error message “The specified module could not be found”. The error log shows the error is thrown while authenticating with SharePoint Online.

File '' not found, check log file for detailed information. System.IO.FileNotFoundException: The specified module could not be found. (Exception from HRESULT: 0x8007007E) at Microsoft.SharePoint.Client.Idcrl.ManagedIdcrl.EnsureInited() at Microsoft.SharePoint.Client.Idcrl.ManagedIdcrl.LogonIdentity(String username, SecureString password) at Microsoft.SharePoint.Client.SharePointOnlineCredentials..ctor(String username, SecureString password) at SPBrowser.Entities.TenantAuthentication.InitClientContext()

What is weird about this, although a FileNotFoundException is thrown, the exception details do not indicate which file is actually missing. #Fail!

What also did not help with resolving my issue was missing automated packaging of the SharePoint Client Browser tool. This is definitely one of those reasons to automate your build process. To ensure the package contains everything it needs, instead of missing a single file due to manual packaging.

So, we do we actually need? When building a solution based on the SharePoint CSOM we require a set of assemblies. Depending we are building for SharePoint 2013 (v15) or SharePoint Online (v16) we need a different set. But what was causing the issue was not one of the CSOM assemblies!

Required assemblies for both SharePoint v15 and v16:

  • MSOIDCLIL.DLL
  • MSOIDRES.DLL

SharePoint CSOM assemblies:

  • Microsoft.SharePoint.Client.dll
  • Microsoft.SharePoint.Client.Runtime.dll
  • Microsoft.SharePoint.Client.Taxonomy.dll

Whatever you release in a package, make sure you include the MSOIDCLIL.DLL and MSOIDRES.DLL assemblies!

Advertisements

Show storage overview for site-collections with PowerShell

PowerShell is very powerful and helps you to quickly get different views on your SharePoint environment. The Usage class can be used to retrieve Storage information for a particular site-collection. Combining this into a PowerShell script provides an overview of storage sizing for your personal storage sites (My Sites) for example.

In this example all My Sites are located within the namespace http://my.contoso.com. When querying the My Sites I’m using this as input. After the basic query I transform the output to get the report.

The first query can be used for the numbers based on megabytes (MB). I’m using the System.Math.Round() method to transform the output based on custom tables in PowerShell.

Get-SPSite -Limit ALL | ?{$_.Url -like "*my.contoso.com*"} | Format-Table Url, @{Expression={[math]::round($_.Usage.Storage/1MB, 3)};Label="Storage"} -AutoSize

The output is shown below.

PowerShell console, output storage query

When I change the formatting for better readability you get the following query. The column Storage is displayed based on string formatting.

Get-SPSite -Limit ALL | ?{$_.Url -like "*my.contoso.com*"} | Format-Table Url, @{Expression={($_.Usage.Storage/1MB).ToString("#,###.000 MB")};Label="Storage"} -AutoSize

This will impact the column Storage shown in the output below.

PowerShell console, output storage query with string Formatting

Enjoy! Have fun with PowerShell.

How to: Detect the installed SKU of SharePoint with PowerShell

Do you need to know which SharePoint SKU or edition is installed on your server? Are you sure your product is not running the trial version? Do you need SharePoint 2010/2013 SKU and/or patch level information from your customer or IT department? This article provides you an easy to use PowerShell script which checks the installed products on a server and outputs the version (patch level).

You can use the Get-SPEdition PowerShell script as is. Simply run the script or use the Functions and call Get-SPEdition. Using the PowerShell scripts results in the following output.

Windows PowerShell: out Get-SPEdition

The script reads the registry to retrieve the installed versions. This information is located in below the “HKLM:software\Microsoft\Shared Tools\Web Server Extensions\15.0\WSS\InstalledProducts” path. Every GUID represents a SKU.

$products = @{ "BEED1F75-C398-4447-AEF1-E66E1F0DF91E" = "SharePoint Foundation 2010"; "1328E89E-7EC8-4F7E-809E-7E945796E511" = "Search Server Express 2010"; "B2C0B444-3914-4ACB-A0B8-7CF50A8F7AA0" = "SharePoint Server 2010 Standard Trial"; "3FDFBCC8-B3E4-4482-91FA-122C6432805C" = "SharePoint Server 2010 Standard"; "88BED06D-8C6B-4E62-AB01-546D6005FE97" = "SharePoint Server 2010 Enterprise Trial"; "D5595F62-449B-4061-B0B2-0CBAD410BB51" = "SharePoint Server 2010 Enterprise"; "BC4C1C97-9013-4033-A0DD-9DC9E6D6C887" = "Search Server 2010 Trial"; "08460AA2-A176-442C-BDCA-26928704D80B" = "Search Server 2010"; "84902853-59F6-4B20-BC7C-DE4F419FEFAD" = "Project Server 2010 Trial"; "ED21638F-97FF-4A65-AD9B-6889B93065E2" = "Project Server 2010"; "926E4E17-087B-47D1-8BD7-91A394BC6196" = "Office Web Apps 2010"; "35466B1A-B17B-4DFB-A703-F74E2A1F5F5E" = "Project Server 2013"; "BC7BAF08-4D97-462C-8411-341052402E71" = "Project Server 2013 Preview"; "C5D855EE-F32B-4A1C-97A8-F0A28CE02F9C" = "SharePoint Server 2013"; "CBF97833-C73A-4BAF-9ED3-D47B3CFF51BE" = "SharePoint Server 2013 Preview"; "B7D84C2B-0754-49E4-B7BE-7EE321DCE0A9" = "SharePoint Server 2013 Enterprise"; "298A586A-E3C1-42F0-AFE0-4BCFDC2E7CD0" = "SharePoint Server 2013 Enterprise Preview"; "D6B57A0D-AE69-4A3E-B031-1F993EE52EDC" = "Microsoft Office Online"; "9FF54EBC-8C12-47D7-854F-3865D4BE8118" = "SharePoint Foundation 2013" } $registryPath = "HKLM:software\Microsoft\Shared Tools\Web Server Extensions\$((Get-SPFarm).BuildVersion.Major).0\WSS\InstalledProducts" Get-RegistryKeyPropertiesAndValues -path $registryPath | ForEach-Object { Write-Host "Installed product: $($products.Get_Item($_.value)) (SKU ID: $($_.value))" } Write-Host "Installed version: $((Get-SPFarm).BuildVersion)"

With a little help from the Scripting Guy (Ed Wilson) and two MSDN articles I build the script. Enjoy!

Download: Get-SPEdition.ps1

Resources:

Developing hybrid SharePoint apps that run on-premise and in the cloud – ESPC 2014

My session at the European SharePoint Conference (#ESPC14) was around developing hybrid apps with the SharePoint App Model. Below you can find the slide deck and PowerShell scripts I used during the demo.

Before you start building hybrid apps who are depending on the authentication done by Azure Control Services (ACS) you need to setup a trust between your on-premise farm and ACS.

  1. Replace the default STS certificate and reboot machine afterwards (Replace-STSCertificate.ps1)
  2. Install Microsoft Online Services Sign-In Assistant for IT Professionals RTW (64-bit), http://www.microsoft.com/en-us/download/details.aspx?id=41950
  3. Install Microsoft Online Services Module for Windows PowerShell (64-bit), http://go.microsoft.com/fwlink/p/?linkid=236297
  4. Run script to connect on-premise SharePoint farm to ACS (Connect-SPFarmToAAD.ps1)

Some important side notes:

  • When replacing the STS certificate, all current trusts who are depending on the STS become invalid. Meaning you have to recreate your existing Trusted Security Token Issuers (Install-TrustedSecurityTokenIssuer.ps1 & Remove-TrustedSecurityTokenIssuer.ps1)
  • Ensure you are using the RTW version of Microsoft Online Services Sign-In Assistant instead of the BETA (which is linked in the TechNet article)

Download PowerShell scripts.

Scripts originate from How to: Use an Office 365 SharePoint site to authorize provider-hosted apps on an on-premises SharePoint site (http://msdn.microsoft.com/en-us/library/office/dn155905(v=office.15).aspx), I don’t own the scripts but only provide them for easy of use.

Error installing SharePoint 2013 SP1 bits on Virtual Machine

As part of creating a developer virtual machine you need to install the SharePoint 2013 bits. Now with the release of Service Pack 1 you can install both SharePoint 2013 and Service Pack 1 in one run.

But when I installed the software bits an exception was raised.

Problem signature:
  Problem Event Name:    OfficeClassicSetup
  SETUP EXE VERSION:    15.0.4454.1000
  SETUP DLL NAME:    SVRSETUP.DLL
  SETUP DLL VERSION:    15.0.4569.1503
  ERROR CODE:    1603
  MSI HRESULT:    Unspecified
  ERROR DETAILS:    FC73469E
  FIRST ERROR CODE:    1603
  OS Version:    6.3.9600.2.0.0.272.7
  Locale ID:    1043

After digging around on the internet and trying different solutions the failing of the installation seems to be related to the CPU count. After increasing the number of virtual processors on the VM to 2 processors and re-running the prerequisites installer and SharePoint 2013 installer everything worked like a charm.

Solution steps:

  1. Increase virtual processor count to at least 2
  2. Re-run SharePoint 2013 prerequisites installer
  3. Re-run SharePoint 2013 installer

Service Pack 1 for SharePoint 2013 and more… [updated]

A bit more than a year ago Microsoft released SharePoint 2013 (RTM: 10/11/2012, GA: 2/28/2013). A couple of days ago Office 2013 Service Pack 1 (2/25/2014) is released, which include Office 2013, SharePoint 2013 and Exchange Server 2013.

With regards to SharePoint the following links are useful:

  • SharePoint Foundation 2013
  • SharePoint Server 2013
  • Project Server 2013
  • Office Web Apps 2013
  • Duet Enterprise
    • Duet Enterprise for Microsoft SharePoint and SAP Server 2.0 Service Pack 1 (SP1), KB 2817426

A more in-depth article on updates included in Service Pack 1 is found on the Microsoft Engineering Team blog, check out Announcing the release of Service Pack 1 for Office 2013 and SharePoint 2013.

Don’t forget to update your Workflow Manager 1.0 with Cumulative Update 1.0 for both Workflow Manager and Service Bus.

[23/04 update: SharePoint 2013 Service Pack 1 was pulled by Microsoft. Yesterday they re-released Service Pack 1, check this post for more information http://blogs.technet.com/b/stefan_gossner/archive/2014/04/22/sp1-for-sharepoint-2013-has-been-rereleased.aspx]

SharePoint Client Browser v1.2, get it while it’s hot!

The release is out since January 13th, but didn’t got the time to write about it. I have released a new version of the SharePoint Client Browser 2013 (#SPCB). It supports new nodes like associated Visitor, Member and Owner groups of a web object and showing the User Custom Actions for site, web and list object.

But the biggest investment is around User Profiles! Check out this post below.

Enjoy this new version of the SharePoint Client Browser and show your gratitude by adding a review on this page. Download can be found here.

SharePoint Client Browser - Main Screen - v1.2

User Profiles support improved!

The biggest update is within the User Profile area. Version 1.1 was limited to only showing the current user’s properties and peers.

SharePoint Client Browser v1.1 support for User Profiles

The new version shows not only the current user, but retrieves other users via the Search CSOM and retrieves their data as well.

SharePoint Client Browser v1.2 extended support for User Profiles

As shown above not only the User Profile properties and Peers are loaded, but lots of new properties is loaded as well allowing to create rich applications who use the User Profile data. Support is based on the Microsoft.SharePoint.Client.UserProfiles namespace and contains per user profile the following information:

  • User Profile properties
  • Peers
  • Direct Reports
  • Extended Managers
  • Extended Reports
  • Followed Tags (only current user)
  • Followers
  • Suggestions (only current user)
  • People Followed by User

Download SharePoint Client Browser

 Download the SharePoint 2013 Client Browser v1.2 here!

Enjoy this new version of the SharePoint Client Browser and show your gratitude by adding a review on this page.

Support for SharePoint 2010 on Windows Server 2012 + R2

When you want to run SharePoint 2010 on either Windows Server 2012 or Windows Server 2012 R2 make sure your SharePoint 2010 is at least running Service Pack 2 (SP2)!Although Hardware and software requirements (SharePoint Server 2010) does not make a note about Windows Server 2012, the KB article 2724471 does outline the support for Windows Server 2012 and Windows Server 2012 R2.

Before the release of Service Pack 2 (SP2) for Microsoft SharePoint Server 2010, Microsoft did not support SharePoint Server 2010 in a Windows Server 2012 or Windows Server 2012 R2 environment. 
However, SharePoint Server 2010 with SP2 has now been released, and this configuration is supported in Windows Server 2012 and Windows Server 2012 R2.

So, it’s supported to run SharePoint 2010 on Windows Server 2012, check out the KB article 2724471 and the description of SharePoint 2010 Service Pack 2. Enjoy all new goodies from Windows Server 2012!

[Update: SharePoint 2013 is not supported on Windows Server 2012 R2 for now. This will be supported when Service Pack 1 is released. Check KB article 2891274.]

[Update: SharePoint 2013 Service Pack 1 is released, check Announcing the release of Service Pack 1 for Office 2013 and SharePoint 2013. Resulting in SharePoint 2013 being supported on Windows Server 2012 R2]

Speaking at the European SharePoint Conference 2014

In case you missed it, the European SharePoint Conference 2014 programme is now available and I’m delighted to announce that I am speaking at Europe’s largest SharePoint event in Barcelona, Spain from the 5-8th May 2014.

I will be conducting a session on “Developing Hybrid SharePoint Apps that Run On-Premise & in the Cloud” aimed at Developers.

“Developing Hybrid SharePoint Apps that Run On-Premise & in the Cloud”

"With the new SharePoint App model running outside the SharePoint worker process it introduces new authentication models. As a developer you don’t want to build multiple versions of the same app implementing each authentication model separately. This session explains the differences between securing SharePoint apps with OAuth in Office 365 and S2S High Trust in on-premise deployments. You will learn how to build a single app that will run on-premise, online and hybrid SharePoint environments.”

clip_image002

The European SharePoint Conference will be run over four days and will feature over 100 informative SharePoint sessions and 6 preconference tutorials providing you with a fantastic opportunity for learning and building your SharePoint skills. Check out the full Conference Programme to see all sessions and topics that are being covered by myself and world renowned SharePoint experts.

If you want to deepen your SharePoint expertise, to understand the trend of the SharePoint market, and to learn how to leverage Microsoft Office 365 for your business, including the revolutionary Enterprise Social wave, the European SharePoint Conference is the best place to be in 2014!

Prices start as low as €995! There is also special group discounts for bookings of 3 or more people.

Book Now and I’ll see you in Barcelona in May

SharePoint Connections Amsterdam 2013 slide deck and Silly Facts demo source code

Last Tuesday and Wednesday the SharePoint Connections Amsterdam 2013 were held in Amsterdam, Netherlands. I did a session on Developing SharePoint 2013 Apps with Visual Studio 2012 and enjoyed it very much.

Besides my session I was on the Ask The Experts team for the DIWUG. Handed out the new edition of the DIWUG SharePoint eMagazine (download for free) and helped people with their questions. At the start of the conference is was quite, but along the way more and more people came up the Ask The Experts panel. Some interesting question, a big thanks for that!

In this article:

Demo 1: Silly Facts SharePoint-hosted App

The Silly Facts demo is about creating a list with silly facts, like the ones below. The list is provisioned in the App web using a Content Type and List Instance artifact.

Site Contents showing the Silly Facts app Default page as part of the app displaying the Facts list instance with generated silly facts 

Once the list is in place I added a App Part (Client Web Part) to the Host web which shows a random fact every time the page gets loaded.

Adding the App Part onto the page (simular like a web part) App Part showing random silly fact on page load

Next to generating silly facts via the JavaScript CSOM a Custom Action is hooked to an Announcement list in the Host web allowing users to easily add new facts to the Facts list.

Extending the context menu via the Custom Action 

Demo 2: Provider-hosted App retrieving data via CSOM and REST

The next demo is extending demo 1 and changing it to a Provider-Hosted app and adding logic for retrieving data with SharePoint via CSOM (Taxonomy) and REST (Search). Changing the SharePoint-Hosted app to a Provider-Hosted app is done in the AppManifest.xml. Here you can change the type and instantly it will ask to generate a Web Project for you.

Next step is adding the chrome which allows you to add a custom menu shown in the top right corner. You can add you own options which integrate with the chrome.

Changing the app type in the AppManifest.xml (in Visual Studio) Provider-Hosted app with chrome and menu customizations (top right corner) 

With everything in place we will retrieve Taxonomy data via the CSOM and perform search queries via the REST API. This is done via code-behind of the Default.aspx on the button click.

After clicking the button "Get Facts" it shows the silly facts with actual data from SharePoint The retrieved data is stored as a facts in the Facts list

Downloads

You can check the slide deck and source if you want. When you have question, please use the comments section below.

Source code is found on Codeplex: https://sillyfacts.codeplex.com/