none
Crear conexión sharepoint 2007 en visual studio RRS feed

  • Pregunta

  • Buenos días,

    He creado un website con visual studio 2008 en el cuál tengo 2 archivos, un aspx y otro aspx.cs.

    En el aspx.cs necesito hacer una consulta de unos campos del sharepoint pero no se como hacerlo.

     

    Gracias de antemano!


    ManuelPa
    miércoles, 15 de junio de 2011 9:55

Todas las respuestas

  • Hola Manuel,

    ¿trabajas con SharePoint 2007 o SharePoint 2010?

    Si es 2007 para conectarte desde una aplicación cliente sólo puedes usar los servicios web, sin embargo, si estas en 2010 tienes, a parte de los servicios web, el modelo de objetos de cliente que es una dll que te permite conectarte y hacer consultas.

    Te dejo una referencia sobre 2010

    http://geeks.ms/blogs/adiazmartin/archive/2010/02/02/sharepoint-2010-client-api.aspx

     


    Alberto Diaz Martin twitter://@adiazcan | http://geeks.ms/blogs/adiazmartin | MVP SharePoint Server
    miércoles, 15 de junio de 2011 18:33
  • Uso Sharepoint 2007 como pone en el tema del Toppic, cuando intento agregar la referencia de Windows Sharepoint Services en el visual studio me da el siguiente error al debugar:

    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.SharePoint.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.SharePoint.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.SharePoint.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
    


    Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053

    Server Error in '/' Application.

    Could not load file or assembly 'Microsoft.SharePoint.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.

     


    ManuelPa
    jueves, 16 de junio de 2011 8:58
  • Hola ManuelPa,

    Para poder trabajar con el MO de SharePoint en tu aplicación web necesitarás disponer en tu entorno de SharePoint ya que en caso contrario no te va a funcionar y tendrás errores como el que comentas.

    Saludos

    jueves, 16 de junio de 2011 9:33
  • Ya dispongo de un entorno de Sharepoint, estoy intentando crear un aspx con un aspx.cs vínculado, pero al intentar crear la conexión de sharepoint añadiendo la referencia Microsofts Sharepoint es cuando me da el error que he indicado más arriba
    ManuelPa
    jueves, 16 de junio de 2011 9:35