Why is Visual Studio 2015 adding stdole.dll and Microsoft.AnalysisServices.AdomdClient.dll to my project?

后端 未结 4 656
天涯浪人
天涯浪人 2020-12-28 13:27

These DLLs are not added to my project in prior versions of Visual Studio. My guess is that one of my references has a dependency to these DLLs. From what I\'ve read, the hi

4条回答
  •  盖世英雄少女心
    2020-12-28 14:07

    If you have the option, use Embed Interop Types and leave stdole.dll out of it all together or you will run into the problem every time you move the application (new servers or dev machines) where stdole.dll isn't signed.

    Problem: There is a reference that is requiring stdole.dll and stdole.dll is now being automatically pushed to the bin folder.

    Solution:

    • Find the reference requiring stdole.dll (more on how to do this below)
    • Go to it's properties (Right click->properties)
    • Change "Embed Interop Types" from false to true.

    How to find the reference: When you click on the properties of your references, check to see if "Embed Interop Types" is set to false. To dig even further, Nick's answer has some great info.

    References I've confirmed so far that use stdole.dll (probably more office programs as well)

    • Office

    • Excel

    • Core

    • Crystal Reports (Thanks Lithium. As Nick points out, you may not have the advantage of setting Embed Interop Types=true)

    • NetOffice OfficeApi

    If you find more, add them to this list or note them in the comments and I'll do it.

    Hans Passant strongly discourages setting Embed Interop Types=false here: What's the difference setting Embed Interop Types true and false in Visual Studio?

    Scott Hanselman also talks about what the "Embed Interop Types" does here: http://www.hanselman.com/blog/CLRAndDLRAndBCLOhMyWhirlwindTourAroundNET4AndVisualStudio2010Beta1.aspx

提交回复
热议问题