1

I am following a tutorial about the deployment and migration api which says that the code needs a reference to Microsoft.SharePoint.dll. The tutorial doesn't explain how to add the reference.

I clicked Add Reference, there is no Microsoft.SharePoint.dll option.

So I checked NuGet Packages, it finds Microsoft.SharePoint.dll, but when I click install, it gives an error message saying:

Could not install package 'Microsoft.SharePoint.dll 15.0.4867.1000'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

How do I get the right version?

The SharePoint version is 2010

The Visual Studio version is 2013

4

As you have SharePoint installed on the development machine (you must), hit Browse... on the Add reference dialog, and you can find the DLL from C:\Program Files\Common Files\microsoft shared\Web Server Extensions\14\ISAPI.

You can also copy the DLL from that folder to your development machine, and reference it there, but you cannot really do much development work unless you have Visual Studio and SharePoint on same machine.

You can find instructions for installing SP on dev box here. However, having dedicated virtual machine (run on some server, or inside your dev machine) for the development is recommended if at all possible in your case.

4
  • That's it, I don't have SharePoint installed on the development machine, was hoping I could use the remotely hosted SharePoint server. – oshirowanen May 4 '18 at 10:27
  • Updated my answer based on this. – Jussi Palo May 4 '18 at 10:28
  • I'll have to set this up properly as you've suggested. Assuming I need to install some form of SharePoint SDK, instead of the full SharePoint? – oshirowanen May 4 '18 at 10:29
  • There is no such SDK that would allow full fledged development, so installing Standalone SP is usually best choice. – Jussi Palo May 4 '18 at 10:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.