Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PackageReference to embeddable interop package *references* the assembly instead of *linking* it #10188

Open
AArnott opened this issue Oct 26, 2020 · 4 comments
Assignees
Labels
Category:Quality Week Issues that should be considered for quality week Functionality:Restore Priority:2 Issues for the current backlog. Resolution:External This issue appears to be External to nuget Style:PackageReference Type:Bug Type:Feature

Comments

@AArnott
Copy link
Contributor

AArnott commented Oct 26, 2020

Per Embed Interop Types with PackageReference and #2365, the recommended pattern for packages that carry embeddable interop assemblies is to construct the package in both lib\ and embed\ folders.

Details about Problem

dotnet.exe --version (if appropriate): 5.0.100-rc.2.20479.15

Detailed repro steps so we can see the same problem

Given a NuGet package that contains an interop assembly under both lib and embed folders, add a PackageReference to it from a .NET SDK style project.

EXPECT

I expect the C# compiler to be invoked with the interop assembly specified with a /link:interop.dll switch.

ACTUAL

The C# compiler is invoked with /reference:interop.dll.
This is the same behavior as if the package didn't use the embed pattern at all.

I do observe that the project.assets.json file does recognize the embed folder:

      "EnvDTE90/16.9.30626.11111-pre": {
        "type": "package",
        "dependencies": {
          "EnvDTE80": "16.9.30626.11111-pre"
        },
        "compile": {
          "lib/net45/EnvDTE90.dll": {}
        },
        "runtime": {
          "lib/net45/EnvDTE90.dll": {}
        },
        "embed": {
          "embed/net45/EnvDTE90.dll": {}
        }
      },

But msbuild still references the dll instead of linking in.

Other suggested things

Verbose Logs

See msbuild.binlog.

Sample Project

sdktest.zip

@nkolev92
Copy link
Member

nkolev92 commented Oct 26, 2020

Hey @AArnott,

Unfortunately the consumption side of PackageReference + embed is not implemented in either SDK or legacy build targets.

Related issue:

cc @aortiz-msft @JonDouglas

This was a feature completed in early 2019, #2365 in NuGet 5.0, but while the NuGet side was done, the SDK/project-system parts were not.

We need to have someone drive the partner side to completion.

@AArnott
Copy link
Contributor Author

AArnott commented Oct 27, 2020

Thanks. Would that be someone on the nuget team that should drive this? It seems like a significant amount of work has already been done on the nuget team, but if it isn't seen through to completion, I'm afraid the spec and closed issue make it look like it should work when it doesn't.

I can perhaps help ping folks to look at those issues, but I certainly have no expertise with the nuget targets/tasks that would be required to get this to work on the consumption side.

@nkolev92
Copy link
Member

nkolev92 commented Oct 28, 2020

Would that be someone on the nuget team that should drive this?

Yes, I think so. The feature is NuGet driven, even if we don't own the codepaths in question.

It seems like a significant amount of work has already been done on the nuget team, but if it isn't seen through to completion, I'm afraid the spec and closed issue make it look like it should work when it doesn't.

I agree, that's very unfortunate.

I'll bring this up at our next triage meeting(Thursday, 10/29) and add the outcome here.

@zkat zkat added Functionality:Restore Priority:2 Issues for the current backlog. and removed Triage:NeedsTriageDiscussion labels Nov 5, 2020
@nkolev92 nkolev92 self-assigned this Nov 19, 2020
@nkolev92 nkolev92 added this to the Sprint 180 - 2020.11.30 milestone Nov 19, 2020
@nkolev92
Copy link
Member

nkolev92 commented Dec 7, 2020

It's on my plate now. I'm gonna try to complete over the next 2 sprints in time for 16.9.

@nkolev92 nkolev92 removed this from the Sprint 181 - 2020.12.21 milestone Jan 11, 2021
@nkolev92 nkolev92 added Category:Quality Week Issues that should be considered for quality week and removed Category:Customer Sprint labels Feb 22, 2021
@nkolev92 nkolev92 added this to the Sprint 2021-02 milestone Feb 22, 2021
@nkolev92 nkolev92 removed this from the Sprint 2021-06 milestone Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category:Quality Week Issues that should be considered for quality week Functionality:Restore Priority:2 Issues for the current backlog. Resolution:External This issue appears to be External to nuget Style:PackageReference Type:Bug Type:Feature
Projects
None yet
Development

No branches or pull requests

4 participants