Odeslat dotazOdeslat dotaz
 

DotazMicrosoft.SharePoint.dll missing

  • 24. října 2007 2:43Nikam Shailesh Uživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     

     

    Hi,

     

    I want to create C# console application which will help me to create list on SharePoint site. I want to develop this application using C#.net on Windows XP prof. Can anybody tell me how can I get reference of Microsoft.SharePoint.dll

    On my machine this file is missing. What should I need to install so that I can add reference of Microsoft.SharePoint.dll?

     

    Thanks

    -Shailesh

Všechny reakce

  • 24. října 2007 3:02Sundar Narasiman MVPMVP, ModerátorUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     

    Microsoft.SharePoint.dll won't be there in your local machine (Wind Xp Machine). Go the the server where sharepoint is installed and copy Microsoft.SharePoint.dll from the following location of the server to your local machine

     

    C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\ISAPI

     

    (if the partition of sharepoint installation is different from "c:\", then change it accordingly).

     

    Then reference this dll in you console application

  • 24. října 2007 3:45Nikam Shailesh Uživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     

    Hi,

     

    I copied all the dlls from 12\ISAPI of Win2003 server to my machines c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\ISAPI. When I tried to run the program I'm getting below error message.

     

    Could not load file or assembly 'Microsoft.SharePoint.Library, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.

     

  • 24. října 2007 9:09Sundar Narasiman MVPMVP, ModerátorUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     

     

    Copy the dll locally to the Bin Directory and then reference the dll in the project. Pls let me know whether this works

     

  • 24. října 2007 11:29Paul GalvinMVP, ModerátorUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     

    In end then, you probably won't be able to run your application on your workstation.  If you want to access MOSS remotely, you would normally use the web services. 

     

    Copying the right .dll's to the workstation will allow you to compile, however.

     

  • 24. října 2007 13:04Nikam Shailesh Uživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     
    Copying Microsoft.SharePoint.dll just helps in proper compilation of code. But it doesn't allow me to execute the code.

    If I use webservice I can't get access to functions which dll provides. like adding list to right hand side collection. Hope you got my problem.

    -Shailesh
  • 24. října 2007 13:17Paul GalvinMVP, ModerátorUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     

    I understand.  You won't be able to write code that interacts with the MOSS/WSS object model via your workstation.  There may be some limited features that work, but remote access has to be done via web services.

     

    I know that you can't use the web services for what you want, so you need to deploy the code to the server and run it there.  You need to compile/copy/execute.  It's awkward.

     

    The usual approach these days is to create a virtual environment and host it on your workstation.  The virtual environment includes windows server, visual studio, etc.  Everything you need to develop and test.  Then, deploy to the real server when ready.

     

     

  • 5. listopadu 2007 1:33Shawn Taylor Uživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     

    I have gone through the same sinerio and have yet to be able to make it work.  In Visual Studio .Net 2003 I try to add a reference for Microsoft.SharePoint.dll that I previously copies to my local XP machine.  I get an error:

     

    "A reference to 'c:\Program Files\Common Files\Microsoft Shared\web server extensions\60\BIN\Microsoft.SharePoint.dll' could not be added.  This is not a valid assembly or COM component.  Only assemblies with extension 'dll' and COM components can be referenced.  Please make sure that the file is accessible, and that it is a valid assembly or COM component."

     

    After reading other documentation I looked in the 'c:\Program Files\Common Files\Microsoft Shared\web server extensions\60\ASAPI' directory on the sharepoint server for Microsoft.SharePoint.dll file.  I did not find it there.  I found it in the 'c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\ASAPI' directory.  I copied it to my local computer. 

     

    From the beginning:

    I download the web parts templates for VB & C# and I ran the setup program. I provide the directory of my dll file and it seemed to work correctly.  However, when I started Visual Studio .Net and tried to create a web part library, it gave me an error that it could not find the dll file.  It told me to re-run the web parts templates program.  So, I did.  Same error repeatedly.

     

    Then I tried to manually add the reference as stated above with the errors stated above.

     

    If someone could help me understand two questions:

     

    #1 - How do I make this dll add in correctly?

    #2 - Why did I find the dll in the ..12\ASAPI directory instead of the ..60\ASAPI directory?

     

    Any help would be appreciated.

     

    Thanks

     

     

  • 14. listopadu 2007 22:57Robert Monteiro Uživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     

    Hi Shawn,

    The problem is that you are developing in Visual Studio 2003 which is .NET 1.1 The dll you are attempting to copy is .NET 2.0. In response to your two questions

    A.1 You will need the older version of the dll from SharePoint 2003 / WSS 2.0

    A.2 The dll was in ..12\ISAPI as this is the location for WSS 3.0 and MOSS 2007. The reference ..60\ISAPI is the location for the older version i.e. WSS 2.0 / SharePoint 2003

     

    You will find more information in another post: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1928956&SiteID=1