Error message when referencing Office core library RRS feed

  • Question

  • Hello Cindy, the code you are referring is in VB.NET and Khalid code is in C# thats why he has using directives. I have the same problem as Khalid but after a tedious search I was not able to find any solution for this problem however, I have referred the Microsoft.Office.Object.Library 12 and still I have the same problem

    Error    4    The type 'Microsoft.Office.Core.CommandBars' is defined in an assembly that is not referenced. You must add a reference to assembly 'office, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c'.

    I have used using Office = Microsoft.Office.Core directive but still I got the aforementioned error any solution is appreciatory. Furthermore, I am using Visual Studio 2008 with SP1.
    • Split by Cindy Meister MVP Tuesday, May 26, 2009 7:12 AM Splitt from answered thread http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/1821cb38-0b0c-4ae0-833d-3daa1e7f74f1 to give better visibility
    Sunday, May 24, 2009 7:19 PM


  • Hello

    Please check the assembly with mentioned PublicKeyToken in your project file(.csproj), this may caused by we reference the wrong assembly by mistake.

    We have published a VSTO FAQ recently, you can view them from the entry thread VSTO FAQ.
    If you have any feedbacks or suggestions on this FAQ, please feel free to write us emails to colbertz@microsoft.com.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by Tim Li Monday, June 1, 2009 3:08 AM
    Monday, June 1, 2009 3:07 AM