8

I've created a nuget package for an interop library. When using this package, Nuget automatically sets "Embed Interop Types" to "True".

However, in my project this should be "False".

Is there a way in Nuget to specify that interop types should not be embedded?

MadSkunk
  • 3,309
  • 2
  • 32
  • 49
Merijn
  • 661
  • 1
  • 7
  • 21

1 Answers1

2

I know it's quite an old question but if someone faces this then follow the below steps :

While creating a NuGet package, add a tools folder and add a file named: install.ps1

Write below PowerShell commands which define the project requirement, In my case, I had to add EmbedInteropTypes: false for SapROTWr library.

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

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

Now add that package to your project and checkout the properties.

sobby01
  • 1,916
  • 1
  • 13
  • 22