Skip to content

Can't correctly embed interop types for packagereference #58

Description

@nduane

While the suggestion here helps:

https://github.com/NuGet/Samples/blob/main/NuGet.Samples.Interop/README.md

and almost works, ie. it will fix it such that VS will build and won't include the interop assembly in the manifest, however, the interface types are not 'dynamic' as they were when you included a 'reference' to an interop assembly. This causes all the method calls/property sets/gets to show 'like' errors, flagged with red squigglies, in the editor even though the build succeeds.

Also, seems the suggestion in:

https://github.com/NuGet/Samples/blob/main/NuGet.Samples.Interop/README.md

is not quite correct. I needed to remove this part:

AND '%(ReferencePath.NuGetPackageId)' == '$(MSBuildThisFileName)'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions