How to set EmbedInteropTypes to True in Nant build

Lư Chân Thanh 1 Reputation point
2021-11-29T14:03:55.203+00:00

In my project already defined in *.project file

<Reference Include="Microsoft.Office.Interop.Excel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
  <EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>

I build the project successfully with VisualStudio. But when using NANT build, it failed with error "cannot implicitly convert type object to ...."

In the Nant build, I defined:

<assemblyfileset id="Sample.assemblies">
        <include name="Microsoft.Office.Interop.Excel" />
</assemblyfileset>

I don't know how to set EmbedInteropTypes to true in Nant build.

Can everyone help me on this?

Community Center | Not monitored
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.