Microsoft.SharePoint und Microsoft.Office-namespace Problem
Ich Lerne aus dem folgenden tutorial zu entwickeln, die Anwendung basiert auf Microsoft Search Server,
http://msdn.microsoft.com/en-us/library/ms497054.aspx
werden und es muss Microsoft.SharePoint und Microsoft.Office-namespaces. Könnte jemand lassen Sie mich wissen, welche SDKs/DLLs erforderlich sind, werden zum Projekt Hinzugefügt, um die Verwendung der namespaces?
Ich bin mit VSTS 2008 + C# + .Net zu entwickeln ASP.Net -Anwendung.
EDIT1: ich habe gedebuggt, die auf einem anderen computer mit WSS 3.0 installiert. Und ich finde die Dlls werden unter "Program Files" aber nicht unter Programme (x86) Ordner. Nach dem hinzufügen der Referenz auf die Dll-Dateien, und führen Sie meine aspx-Seite bekam ich folgende Fehlermeldung, jemand eine Idee was falsch ist?
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
Du musst angemeldet sein, um einen Kommentar abzugeben.
Ich denke, Sie müssen nur WSS installiert und nicht MOSS. Sie benötigen MOSS installiert ist oben auf der WSS zu bekommen, um die Funktionen und Baugruppen, die Sie suchen.
WSS-DLLs (Wenn das ist alles, was Sie sehen, Sie müssen nur WSS installiert)
Microsoft.SharePoint.dll
Microsoft.SharePoint.Search.dll
Microsoft.SharePoint.Security.dll
microsoft.sharepoint.WorkflowActions.dll
OWSSVR.DLL
SHTML.DLL
MOOS DLLs (Zusätzlich zu den WSS-DLLs)
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
(Quelle: MSDN)
Den main .dlls für SharePoint sind
Microsoft.SharePoint.dll
undMicrosoft.Office.Server.dll
, die sich in%ProgramFiles%\Common Files\microsoft shared\Web Server Extensions\12\ISAPI
,Einfach die microsoft.sharepoint.dll in den bin-Ordner der web-Anwendung. Werfen Sie einen Blick auf diesen Beitrag: https://sharepoint.stackexchange.com/questions/35502/how-to-add-reference-for-microsoft-sharepoint-to-a-web-application
Versuchen Sie auch, suchen in C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI für die dll. Das ist, wo es ist für Sharepoint 2010 auf Windows Server 2008. Ich denke, die "12" - Struktur ist für Sharepoint 2007. Wenn Sie Sharepoint 2010 verwenden, dann ist es 64 bit, so dass Sie Aussehen würde, in "Program Files" und nicht "Program Files (x86)".
Mit der dll in Ihrem Ordner "bin", nun können Sie
using microsoft.sharepoint;
in Ihr .cs-codebehind-Dateien.