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?
A . nuspec file is an XML manifest that contains package metadata. This manifest is used both to build the package and to provide information to consumers. The manifest is always included in a package.
There is the Manifest class which is used to read the . nuspec file. The ZipPackage does not directly give you access to the Manifest. Information from the Manifest is available as properties on the ZipPackage class.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With