none
Can't build VSTO project with MSBuild RRS feed

  • Question

  • I would like to be able to build my VSTO project using MSBuild. But I get a string of "are you missing an assembly reference?" Here are the top few:

    CSC : error CS1748: Cannot find the interop type that matches the embedded interop type 'Microsoft.Office.Tools.Ribbon.IRibbonExtension'. Are you missing an assembly reference?

    Sheet1.cs(9,17): error CS0234: The type or namespace name 'VisualStudio' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

    Ribbon1.cs(190,51): error CS0246: The type or namespace name 'RibbonControlEventArgs' could not be found (are you missing a using directive or an assembly reference?)

    What do I need to do to help MSBuild find these references?

    Wednesday, April 24, 2013 10:48 PM

Answers

  • Hi Jeffki, 

    You must set "Embed Interop Types" property to true for Microsoft.Office.Interop.Excel.

    And then you can follow the steps on the below article described:

    Build VSTO without Visual Studio. 

    I help this response can help you. Thanks 


    If my post is helpful,please help to vote as helpful, if my post solve your question, please help to make it as answer. my sample

    Friday, April 26, 2013 3:17 AM

All replies

  • Hi jeffki, 

    You can read the below thread to get help, I think that thread can help you solve your question.

    How can I build a VSTO project on my build server which has not installed the Visual Studio

    you can get more detail steps from the article

    Thanks.


    If my post is helpful,please help to vote as helpful, if my post solve your question, please help to make it as answer. my sample

    Thursday, April 25, 2013 2:25 AM
  • I am building from the same machine that I have VS installed on so I would not expect to have to do all of the things mentioned in the thread. I did make a local copy of all my references and now I get a host of other errors.

    I get a handful like this:

    Properties\AssemblyInfo.cs(12,12): error CS0579: Duplicate 'AssemblyCompany' attribute

    And a bunch like this:

    Column.cs : error CS3008: Warning as Error: Identifier 'Microsoft.Office.Interop.Excel._Workbook' is not CLS-compliant

    Thursday, April 25, 2013 3:34 PM
  • you  aslo can check the article and you can update the AssemblyInfo.cs file, set to [assembly: AssemblyCompany("")].

    If my post is helpful,please help to vote as helpful, if my post solve your question, please help to make it as answer. my sample

    Thursday, April 25, 2013 3:42 PM
  • I have read the referenced article and my AssemblyInfo.cs file is correct.
    Thursday, April 25, 2013 3:46 PM
  • Hi Jeffki, 

    You must set "Embed Interop Types" property to true for Microsoft.Office.Interop.Excel.

    And then you can follow the steps on the below article described:

    Build VSTO without Visual Studio. 

    I help this response can help you. Thanks 


    If my post is helpful,please help to vote as helpful, if my post solve your question, please help to make it as answer. my sample

    Friday, April 26, 2013 3:17 AM
  • Can you please post the article and the sample again, they are not available anymore. Thanks.

    Tuesday, July 14, 2015 2:26 PM