locked
Embed Interop Types? RRS feed

  • Question

  • I recently have been trying to migrate a WCF project to .NET 4. During the build I get the following warning:
    Warning 8 A reference was created to embedded interop assembly 'c:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Accessibility.dll' because of an indirect reference to that assembly created by assembly 'c:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\WindowsBase.dll'. Consider changing the 'Embed Interop Types' property on either assembly. ServiceModelEx
    I don't know how to interpret this warning. It seems that the two assemblies that are mentioned in the warning are part of the .NET Framework so the suggestion to change the "'Embed Interop Types' property on either assembly", seems to be not applicable and I am not sure how to implement even if the warning was considered applicable. Ideas?
    Thank you.
    Kevin

    Kevin Burton
    Wednesday, December 7, 2011 9:00 PM

Answers

  • Kevin,

     

    It's on the individual references - not in the project properties.  In the solution explorer window, open "References" (under the project), and click on the reference in question.  The properties window will have an option for Embed Interop Types (for each reference).


    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    • Marked as answer by KevinBurton Friday, December 9, 2011 6:15 PM
    Friday, December 9, 2011 5:14 PM

All replies

  • In your project references, right click on "SeviceModelEx" and choose Properties.  Make sure to turn off "EMbed Interop Types" and try rebuilding.
    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    Wednesday, December 7, 2011 9:49 PM
  • Hi Kevin,

     

    I am writing to check the status of the issue on your side. Would you mind letting us know the result of the suggestions?

     

    If you have got answers, please remember to mark answer and close this thread.

    If not, any more concerns, please feel free to let us know.

     

    Have a nice day!


    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Friday, December 9, 2011 8:40 AM
  • Hello,

     

    Thank you for reminding me. I have not been able to get to try the suggestions until today. 

     

    I am having a hard time finding the "Embed Interop Types" property. I see the attached screen with Visual Studio.

     


    Kevin Burton
    Friday, December 9, 2011 4:59 PM
  • Kevin,

     

    It's on the individual references - not in the project properties.  In the solution explorer window, open "References" (under the project), and click on the reference in question.  The properties window will have an option for Embed Interop Types (for each reference).


    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    • Marked as answer by KevinBurton Friday, December 9, 2011 6:15 PM
    Friday, December 9, 2011 5:14 PM
  • I changed the referenced assembly 'Accessibility' Embedded Interop Types property to false. That seemed to get rid of the warning. I guess that prompts a couple of other questions if you don't mind. Why is this an issue with .NET 4 or Visual Studio? What have I limited by changing this property to FALSE?

    Thanks again.

     


    Kevin Burton
    Friday, December 9, 2011 6:19 PM
  • I changed the referenced assembly 'Accessibility' Embedded Interop Types property to false. That seemed to get rid of the warning. I guess that prompts a couple of other questions if you don't mind. Why is this an issue with .NET 4 or Visual Studio? What have I limited by changing this property to FALSE?

    Thanks again.

     


    Kevin Burton

    Interop type embedding is a new feature in .NET 4.  Turning this off makes it behave more like .NET 3.5...

     

    It's really mostly useful for COM - if you search around for NOPIA support, you'll find out all about it.  Basically, it lets you distribute without the primary interop assemblies, since it embeds the proper portion of them into your app.

    Unfortunately, the upgrade conversion routines tend to turn it on for things where they shouldn't....


    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    Friday, December 9, 2011 6:21 PM
  • Hi,

    I am getting the following error when i try to build a project in VS 2012 -

    Error 294 Cannot embed interop type 'Microsoft.Office.Core.MsoBlogImageType' found in both assembly 'd:\Code\PlusSuite\OfficeAddIn.Excel\obj\x86\Debug\Interop.Microsoft.Office.Core.dll' and 'c:\Program Files\Microsoft Visual Studio 9.0\Visual Studio Tools for Office\PIA\Office12\Office.dll'. Consider setting the 'Embed Interop Types' property to false.

    But I do not see the 'Embed Interop Types' property for the reference in question. I tried following the steps mentioned here, but it dint help much. 

    Please help resolving this issue.

    Thanks in Advance,

    Naina

    Tuesday, February 25, 2014 9:21 AM