0

My nuget package project is a structured like following (very simple):

- lib
 MyCom.dll
- tools
 Init.ps1

Init ps1's content:

param($installPath, $toolsPath, $package, $project)

$project.Object.References | Where-Object { $_.Name -eq "MyCom" } |  ForEach-Object { $_.EmbedInteropTypes = $false }

Nuget spec:

<?xml version="1.0"?>
<package >
  <metadata>
    <id>***</id>
    <version>***</version>
    <title>***</title>
    <authors>***</authors>
    <owners>***</owners>
    <licenseUrl>***</licenseUrl>
    <projectUrl>***</projectUrl>
    <iconUrl>***</iconUrl>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>***</description>
    <releaseNotes>***</releaseNotes>
    <copyright>Copyright 2018</copyright>
    <tags>***</tags>
    <references>
      <reference file="MyCom.dll" />
    </references>
  </metadata>
  <files>
    <file src="lib\MyCom.dll" target="lib" />
  </files>
</package>

I don't know why init is not setting myCom.dll embed interop to false. Same thing happens if I use Install.ps1.

I'm using VS 2015.

Amen Jlili
  • 1,884
  • 4
  • 28
  • 51

1 Answers1

0

Just needed to add the init powershell script to the files tag.

 <files>
    <file src="tools\Init.ps1" target="tools\Init.ps1" />
 <-- more files here !-->
</files>
Amen Jlili
  • 1,884
  • 4
  • 28
  • 51