Getting an error while creating an object of SPWeb

Copper Contributor

Hello All,

I've created one .net application to connect to a SharePoint environment and create some folders at a specific path.

While creating an object of the web I'm facing below error -

An unhandled exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll

Additional information: Could not load file or assembly 'Microsoft.SharePoint.Library, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.


Does anyone have face similar problem in the past? If yes then please advise how to get rid of this.

Any help would be much appreciated.

Thank you

1 Reply

Ensure that you have referenced the assemblies "Microsoft.SharePoint.Client.dll" and "Microsoft.SharePoint.Client.Runtime.dll" in your .NET Project. Also ensure that these files are exists in the .NET Exe running environment.

 

The assemblies may exists in the path like below one if you have installed the SharePoint Online SDK Components:

"C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
"C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"