Powershell Error connecting to SharePoint Online using CSOM Assemblies

April 27, 2018

When using a Powershell Script to connect to SharePoint Online I got this error…

msoidcliL.dll : System.IO.FileNotFoundException – SharePointOnlineCredentials


Solution :

Update your SP client side Assemblies, which does not rely anymore on Msoidclil.dll



Once updated the error was gone Smile

Enjoy !

Windows Core IoT – ASP DotNet Core Razor Pages on a Raspberry PI3

April 20, 2018

Continuing on based on my prior posts

.Net Core on RPI3

SQLite on RPI3

I am going to explain how to use Windows IoT and ASP .Net Core on a RPI3.

As of version 2.0 we now can create ASP Razor webpages in .NET Core.

Remember that in the past I made some post about Web Matrix

That is in fact the predecessor of ASP .Net Core. Read more here

How to use Razor Pages in ASP.NET Core 2.0

Start with installing the DotNet Core Template to begin with

Run command :

dotnet new Razor -n ASPnetCoreRazor -o C:\CoreIoT\ASPnetCoreRazor


Next Run the Template Application on your Windows PC.

Use command :

cd C:\CoreIoT\ASPnetCoreRazor

dotnet Run


Voila as simple as that Smile


Next Publish it for Windows IoT on a RPI3 Architecture

Run command :

dotnet publish -r win8-arm


Copy the files to your RPI3 from C:\CoreIoT\ASPnetCoreRazor\bin\Debug\netcoreapp2.0\win8-arm\publish


Connect to RPI3 using PowerShell remote session and start the ASPNetCoreRazor.exe Application


No connection … ? Sad smile



1. You need to open the Firewall Port 5000 on your RPI3 first.

Run command :

netsh advfirewall firewall add rule name=” ASPnetCoreRazor ” dir=in action=allow protocol=TCP localport=5000


2. Modify the Template Program.cs script

And add this line : .UseUrls(http://*:5000)


Publish again :

dotnet publish -r win8-arm


Copy the files back over to your RPI3 :


Next connect to RPI3 using PowerShell and start the app ….



Open the browser and go to : http://rpi3:5000


It runs as expected !! Smile

So now we know how to create RAZOR pages, the door is open to start experimenting with the RAZOR syntax.

As well as integrating SQLite database using the ASP .NetCore Razor Front End….

Enjoy !

Windows Core IoT – SQLite on a Raspberry PI3

April 15, 2018

As shown in the previous post you can run use Dotnet Core to compile apps for Windows IoT on a RPI3

See here how to get started with Dotnet Core

On the net you can find how to use Dotnet Core and SQLite :


But the example uses the Dotnet Core v1.0 Framework and run on Windows.

I will show here how to use the latest Dotnet Core v2.0 Framework and publish it for Windows ARM on RPI3 Winking smile

Run command Dotnet new console –n Sqlite –o C:\DotNetCoreApps\Sqlite

And check the result here :


Copy the program.cs as backup, and copy the program code from the site above into the program.cs file.

Change the namespace to SQLite (see-n SQLite in first command)


Change the sqlite.csproj file content by adding a few lines


Add these line :


<Project Sdk=”Microsoft.NET.Sdk”>

<PackageReference Include=”Microsoft.EntityFrameworkCore.Sqlite” Version=”2.0.2″ />
<PackageReference Include=”SQLitePCLRaw.bundle_green” Version=”1.1.10″ />

     <DotNetCliToolReference Include=”Microsoft.EntityFrameworkCore.Tools.DotNet” Version=”2.0.0″ />

Run command : dotnet Restore


As you can see it will use some Nuget packages as included in the sqlite.csproj file

Next run this command : dotnet publish -r win8-arm

And copy the files to your RPI3


Next open PowerShell do a remote session and run the .\SQLite.exe


When the SQLite DB doesn’t exist yet, it will be created automatically.


DotNet Core is really a cross-platform language !

It runs flawlessly on a RPI3 – ARM Architecture, by just re-using the same code base we use on a Windows machine Smile

See here for more info on .NET Core Data Access data sources :


Enjoy !

Windows Core IoT – DotNet Core on a Raspberry PI3

April 15, 2018

Before we can start creating a project using .NET Core for RPI3, we first need to explain what and why we use .NET CORE !

.NET Core supports three app models:

  • ASP.NET apps and services
  • Console apps
  • Universal Windows Platform (UWP) apps

First of all .Net CORE is a Cross-Platform Framework opposed to the regular .Net Framework.

Supporting the following platforms:

  • Windows
  • OS X
  • Linux

Read more about .Net Frameworks here


More info you can find here and here


Since RPI3 runs on an ARM architecture we can’t just use Standard .Net Assemblies to build projects…

You can now easily convert a platform-specific class library into a portable class library by publishing to another platform.


I will show you an example as we go along.


Getting Started

As being a scripter I hate to install all the overhead on my PC just to do simple things !

That’s why will only use the Command Line Interface (CLI) and NO Visual Studio Smile


Prerequisites :

We first have to install the .Net Core SDK on you desktop PC.

At the moment MS has arrived at .Net Core SDK version 2.1.103, Download here



This is all you need to do a quick start Smile


Once installed open the Command Prompt and let’s check the version installed.

Run command : dotnet /? to get all options.


To get the version info we run the command:

dotnet –version or even better is dotnet –info


.Net Core Extensions

In contrast to the .NET Framework, the .NET Core platform will be delivered as a set of NuGet packages.

These extension are needed to build your applications. We will come back to this later on showing the examples…





You can download packages manually from the Nuget Site and open them using 7-zip.

And extract the libraries you need for your environment…


As mentioned before instead of using Visual Studio to start our for project.


We will just use the DotNet Core Command line Tools, to build the first Console App in .Net Core for RPI3.

.Net Core has the same Template Apps as you can get through Visual Studio, let’s see what is available.

Run command : dotnet new


Also RAZOR pages are possible as you can see Smile


.Net Core Console App

1. Console app Template :


Run command : dotnet new console

optional parameters are :

–n specifies the name of the project

-o specifies the output location, if omitted it will create the project in the %userprofile%  dir.

dotnet new console -n MyFirstCoreApp -o c:\coreiot



The Template app has generated this code



2. Run the console app.

cd c:\coreiot

Dotnet run

dotnet publish -r win8-arm



3. Publish to RPI3

In order to use it on RPI3 or Linux we need to add a few lines in the MyFirstCoreApp.csproj file




Remember the RuntimeFrameworkVersion you can find in the .Net Core Info see

See dotnet –Info

Next run the dotnet restore command


Next run the dotnet publish -r win8-arm command


or if you focus a Linux distribution you run the command

dotnet publish -r ubuntu.16.04-arm


4. Copy the app to the RPI3




5. Using PowerShell to run it

cd to your app folder



Runs as expected Smile


6. Change the code using an input parameter




Console.WriteLine(“\nWhat is your name? “);
var name = Console.ReadLine();
var date = DateTime.Now;
Console.WriteLine($”\nHello, {name}, on {date:d} at {date:t}!”);
Console.Write(“\nPress any key to exit…”);


Run command : dotnet run



Next run command : dotnet publish -r win8-arm


And copy it back to RPI3 and test it using PowerShell


Next see here for an SQLite Example on RPI3

Next see here for an ASP .Net Core Example on RPI3


PS :

Keep in mind that for Windows there is a nice Extension Library.

That gives you access to about 20.000 Windows API’s

Run this command to add it to your project

dotnet add package Microsoft.Windows.Compatibility –version 2.0.0

Enjoy !

SharePoint – Growing USAGE files

April 9, 2018

Your SharePoint Server might run out of disk space, because of growing .USAGE files.

These files capture the visitor analytics of your SharePoint farm.

Every X minutes it will create a new .USAGE file in the C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS folder


Which can take up several GB’s after a month…


1. Delete these files

Stop the SharePoint Timer Service


Delete all the .USAGE files

2. Reduce the number of retention days

Second option is to set the DaysRetained to a lower value




if((Get-PSSnapin | Where {$_.Name -eq "Microsoft.SharePoint.PowerShell"}) -eq $null)
    Add-PSSnapin Microsoft.SharePoint.PowerShell;

Set-SPUsageDefinition -Identity "Page Requests" -DaysRetained 5

Get-SPUsageDefinition -Identity "Page Requests"


If this does not work, you should schedule a Timer Job see solution 1. To restart the SharePoint Timer Service after x number of days

Enjoy !

MAPISendMail Error 26

April 6, 2018

Recently I ran into an Error 26 – MAPISendMail Failed

Using a Windows 10 Pro x64 and an Outlook 2010 installation.

This Error was triggered if an external Application (FormDesigner) was trying to send an Email using the users MAPI Profile in Outlook.


Solution :

1. Close Outlook

2. Locate folder :

x64 : C:\Program Files\Common Files\System\Msmapi\1033 or

x32 : C:\Program Files (x86)\Common Files\system\MSMAPI\1033

3. Rename MSMapi32.dll to MSMapi32.old

4. Open outlook again. Outlook will repair the file again.

5. Test it, the Email work again.

And the Error will be gone too Smile

Enjoy !