Q:

CodeDom - XML flag into some common sense

if i review the .csproj of my Test solution i see a flag as follows:
<ItemGroup>
<Reference Include="Interop.Encore">
<HintPath>..\..\..\..\..\..\\Interop.Encore.dll</HintPath>
**<EmbedInteropTypes>False</EmbedInteropTypes>**
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>

My question si i need to set the EmbedInteropTypes to false within the CodeDom project before it generates a .DLL on it's own. (dll that holds non EmbedInteropType dll's)
Anyone have a solution ?
I'm looking at 
_CurrentCodeFile.AssemblyCustomAttributes.Add(
   new CodeAttributeDeclaration("EmbedInteropTypes", new CodeAttributeArgument[] { new 
      CodeAttributeArgument(
         new CodePrimitiveExpression(false))}));

Any suggestions ?

A:

First, I think you misunderstand what assembly attributes are. They are usually placed in AssemblyInfo.cs and look like [assembly:AssemblyCultureAttribute("de")]. And there is no EmbedInteropTypes attribute that I could find.
Now, based on my tests with referencing COM assemblies using CodeDOM, you don't need to do anything special if you don't want to embed the interop assembly, just reference it.
On the other hand, if you did want to embed it, you would need to explicitly use the /link command line option, by setting CompilerOptions.

