Microsoft.SharePoint et Microsoft.Office d'espace de noms problème
Je suis en apprentissage depuis le tutoriel suivant de développer des applications basées sur Microsoft Search Server,
http://msdn.microsoft.com/en-us/library/ms497054.aspx
et il a besoin de Microsoft.SharePoint et Microsoft.Office des espaces de noms. Quelqu'un pourrait-il me faire savoir qui SDKs/Dll sont nécessaires pour être ajouté à projet afin d'utiliser les espaces de noms?
Je suis à l'aide de VSTS 2008 + C# + .Net afin de développer une ASP.Net application.
EDIT1: j'ai débogué sur un autre ordinateur avec WSS 3.0. Et je trouve que le Dll dans le dossier Program Files, mais pas dans Program Files (x86) dossier. Après l'ajout de la référence à la Dll, et d'exécuter ma page aspx, j'ai eu le message d'erreur suivant, toutes les idées de ce qui est mal?
Server Error in '/' Application.
--------------------------------------------------------------------------------
Could not load file or assembly 'Microsoft.Office.Server.Search, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.BadImageFormatException: Could not load file or assembly 'Microsoft.Office.Server.Search, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[BadImageFormatException: Could not load file or assembly 'Microsoft.Office.Server.Search, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +43
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +127
System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +142
System.Reflection.Assembly.Load(String assemblyString) +28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46
[ConfigurationErrorsException: Could not load file or assembly 'Microsoft.Office.Server.Search, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +613
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +203
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +105
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178
System.Web.Compilation.WebDirectoryBatchCompiler..ctor(VirtualDirectory vdir) +163
System.Web.Compilation.BuildManager.BatchCompileWebDirectoryInternal(VirtualDirectory vdir, Boolean ignoreErrors) +53
System.Web.Compilation.BuildManager.BatchCompileWebDirectory(VirtualDirectory vdir, VirtualPath virtualDir, Boolean ignoreErrors) +175
System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +83
System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +261
System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +101
System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +126
System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +62
System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +33
System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +40
System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +160
System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +93
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
Vous devez vous connecter pour publier un commentaire.
Je pense que vous avez juste WSS installé et pas de la MOUSSE. Vous avez besoin de la MOUSSE installé sur le dessus de WSS pour obtenir les caractéristiques et les assemblées vous êtes à la recherche pour.
WSS Dll (Si c'est tout ce que vous voyez, vous avez juste WSS installé)
Microsoft.SharePoint.dll
Microsoft.SharePoint.Search.dll
Microsoft.SharePoint.Security.dll
microsoft.sharepoint.WorkflowActions.dll
OWSSVR.DLL
SHTML.DLL
MOSS Dll (En Plus de la WSS Dll)
Microsoft.Office.Excel.Server.Udf.dll
Microsoft.Office.Excel.Server.WebServices.dll
Microsoft.Office.Policy.dll
Microsoft.Office.Server.dll
Microsoft.Office.Server.Search.dll
microsoft.office.workflow.tasks.dll
microsoft.sharepoint.portal.dll
Microsoft.SharePoint.Portal.SingleSignOn.dll
Microsoft.SharePoint.Portal.SingleSignOn.Security.dll
Microsoft.SharePoint.Publishing.dll
SSOCLI.DLL
(Source: MSDN)
Le principal .dll pour SharePoint sont
Microsoft.SharePoint.dll
etMicrosoft.Office.Server.dll
, qui sont situés dans%ProgramFiles%\Common Files\microsoft shared\Web Server Extensions\12\ISAPI
,Il suffit de mettre la microsoft.sharepoint.dll dans le dossier bin de votre application web. Jetez un oeil à ce post: https://sharepoint.stackexchange.com/questions/35502/how-to-add-reference-for-microsoft-sharepoint-to-a-web-application
Aussi, essayez de rechercher dans C:\Program Files\Fichiers Communs\Microsoft Shared\Web Server Extensions\14\ISAPI pour la dll. C'est là où il est pour Sharepoint 2010 sur Windows Server 2008. Je pense que le "12" de la ruche est pour Sharepoint 2007. Si vous utilisez Sharepoint 2010, alors qu'il est en 64 bits, de sorte que vous vous regardez dans "Program Files" et non pas "Program Files (x86)".
Avec la dll dans le dossier bin, maintenant, vous pouvez utiliser
using microsoft.sharepoint;
dans votre .cs codebehind fichiers.