Add a reference of the Microsoft.Online.Administration.Automation.PSModule dll to your Project in Visual Studio

First of all make sure that all the required items are already installed on your machine. You can view the requirements here, https://realmpksharepoint.wordpress.com/2014/07/10/install-sharepoint-online-management-shell-on-client-side/. The Microsoft.Online.Administration.Automation.PSModule dll is required to execute the
Connect-MsolService

command and get the return values in the form of type, Microsoft.Online.Administration.User from within the .net C# code. Well, it’s supposed to be a simple job of adding a reference of this dll to your project. The problem is to identify the location of this dll.

Initially, I did some googling to download the dll. However, I couldn’t find any trusted source (Microsoft) from where I can download this dll. Then, I realized that this dll should have been downloaded with the installation of Windows Azure Active Directory Module. Hence, I navigated to that location I found the dll at the following location

C:\Windows\System32\WindowsPowerShell\v1.0\Modules\MSOnline

Unfortunately, the job’s not done yet. A strange thing started happening here. Though, I can view this dll in my Explorer. The folder, MSOnline was inaccessible from the Visual Studio Add Reference window!

Still, I am not aware of this weird behavior. What I did to resolve this issue is, I copied the entire MSOnline folder to the bin directory of the project and from there I was able to add the dll’s reference to the project.

One thought on “Add a reference of the Microsoft.Online.Administration.Automation.PSModule dll to your Project in Visual Studio

  1. Thanks for the blog. C:\Windows\System32\WindowsPowerShell\v1.0\Modules\MSOnline is not accessible from visual studio on my system as well.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s