VS 15.7.0 Preview 1.0
NuGet.exe version: 4.5.1.4879
nuget.exe pack <packageName>.nuspec containing an arbitrary .targets file.project.assets.json fileThe target file from the package is not referenced.
While this behavior is by design it'd be better to emit a warning per included target file if it doesn't match certain criteria. The warning can be generated by pack as well as install command.
@alpaix you know the code, send a PR ;) (JK)
Target file was not referenced until I renamed it after the package name. I presume there's no workaround for that limitation?
no. that is by design.
It's a good idea to add the warning to the pack validation.
is there a specific scenario where you wouldn't want the target file to be named after the package id?
We were trying to package interop assemblies with a boilerplate targets file setting EmbedInteropTypes property to true. So we spent some time trying to understand why it didn't work.
@nkolev92 can you provide Alex with the recommended way of including interop assemblies? I know we have a GitHub sample somewhere
oh, here it is : https://github.com/NuGet/Samples/tree/master/NuGet.Samples.Interop
CC: @alpaix 
Cool! Thanks! I think I've got one of this sample project variations.
Most helpful comment
no. that is by design.
It's a good idea to add the warning to the pack validation.