Why is Microsoft.SharePoint.Search.dll copied to my project?

When working on the VS2005 project, which includes a link to the Microsoft.SharePoint.dll file, creating the project causes Microsoft.SharePoint.Search.dll to be copied to the bin folder. Why is this? Well, maybe this is just a mistake, but I want to know the mechanism.

[Edit: Copy local file is definitely disabled - Microsoft.SharePoint.dll has not been copied. Microsoft.SharePoint.Search.dll is not in the GAC, but it doesn’t matter if it was.]

+4
source share
7 answers

What worked for me is

  • add a link to Microsoft.SharePoint and Microsoft.SharePoint.Search (even if you don't need it)
  • set Copy Local to false for both links.

When you create a project, none of them are copied to debug / release / any directory.

+1
source
  • This is not in the GAC
  • It is used by one of the links you link to (I think Microsoft.Sharepoint.dll refers to it)
  • Since you are not referencing it, you cannot set Local Copy to FALSE, as far as I know
  • I modified the build / deployment scripts to just delete it.
+3
source

Have you tried disabling "Copy local" in the properties for a link to Microsoft.SharePoint.dll?

0
source

maybe because it is not in the GAC, because other files in the GAC are not copied there.

0
source

This is probably a dependency, and you have a local copy enabled.

I would keep a local local copy, as this really alleviates the pain of deployment.

0
source

If you put (host) where you compile the assembly, which is the x64 architecture, and you have installed version 64 for the 64-bit version of SharePoint (with the links installed for these assemblies) while adding the link, it will install Copy local to false,

So, if the assembly is AMD64, and you have "Any CPU" installed, then the "add reference" sets the copy local = true, regardless. If you change it to false, but then refer to this project to another, which also has the Any CPU or NOT x64 target set, then the link will also be copied.

Take a look at the MSBuild settings as needed in this link: How to override CopyLocal (Private) parameter for links in .NET from MSBUILD

0
source

Ok, I just wanted to add to the answer with this explanation:

1) In my project, I had links to: Microsoft.SharePoint Microsoft.SharePoint.Publishing

2) On the x64 virtual moss 2007 server, when I compiled my project, I added the following files to my bin / debug: ssocli.dll, Microsoft.SharePoint.Portal.SingleSignon.dll, Microsoft.SharePoint.Search.dll, Microsoft.SharePoint .Search.xml, Microsoft.Office.Server.Search.dll.

Interestingly, I did not have this problem on my x86 virtual server.

3) All these files can be found in the files c: \ program \ Common Files \ Microsoft Shared \ Web Server Extensions \ bin \ ISAPI.

4) According to the answer I found on the MSDN forum, referencing DLLs probably refer to or depend on additional DLLs. Because of this, they are added to the bin / debug folder.

5) To prevent this from happening, you can reference the dependent DLLs in your project and set the local copy to false.

https://social.msdn.microsoft.com/Forums/sharepoint/en-US/192fa94c-b588-401d-8ca8-845c3fe15f60/could-not-load-file-or-assembly-microsoftsharepointsearch-version12000-cultureneutral?forum= sharepointdevelopmentlegacy

0
source

Source: https://habr.com/ru/post/1277706/


All Articles