Cannot embed interop types from assembly 'Microsoft.SharePoint' because it is missing the 'Guid' attribute

Posted on 2011-10-26
Last Modified: 2013-09-16
I'm trying to write an app in VB to access a SharePoint list.  

I have a 2003 server, with SharePoint 2007 installed on it, as well as Visual Studio 2010.

I've added a reference to Microsoft.SharePoint.dll in the \isapi\  directory, and added "Imports Microsoft.sharepoint" to my application. (Notice the lowercase 'sharepoint'... it didn't correct it, so I'm assuming it can't find it.)  This is confirmed when I attempt to create an object of type SPSIte (when trying to build the application):

"Error      1      Cannot embed interop types from assembly 'Microsoft.SharePoint' because it is missing either the 'ImportedFromTypeLib' attribute or the 'PrimaryInteropAssembly' attribute.      WpfApplication3"

Error      2      Cannot embed interop types from assembly 'Microsoft.SharePoint' because it is missing the 'Guid' attribute.      WpfApplication3

So.....  what I am doing wrong?
Question by:scmace
    1 Comment
    LVL 9

    Accepted Solution

    Right click references, add reference, under .NET add Microsoft.SharePoint.

    Need to ensure that it is targeted as a .NET 3.5 app not 4

    Projects / appname properties

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Work Over Net is a new and very powerful collaboration product. With its new easy interface it is becoming very competitive to other similar products like webex and office interactive. WON 2010 have the standard business tools needed for multi-offic…
    Last week I faced a strange issue recently, i have deployed SharePoint 2003 servers for one project and one of the requirements was to open SharePoint site from same server. when i was trying to open site from the same server i was getting authentic…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now