Pergunta

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

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a sharepoint.stackexchange
scroll top