-
Notifications
You must be signed in to change notification settings - Fork 258
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
The MSBuild "pack" target is missing a property for explicit assembly references #6858
Comments
@rohit21agrawal can you quick peek into this and respond accordingly? |
currently this capability does not exist. We will add this to our feature backlog. Thanks for reporting! |
I have an additional question/request. My nuget package consists of two assemblies: A.DLL and B.DLL, The consumer of my package (a.k.a. the target project) only needs to reference A.DLL, but A.DLL requires B.DLL at runtime. This is why I added an explicit assembly reference to A.DLL using the However, I'm now targeting .NET Standard and I found out that |
@MaxG117 can you show us the nuspec you use to build your package, and the nuspec that's present inside the generated package, along with the contents of the obj folder (*.g.props, *.g.targets, project.assets.json) , after you run a restore? |
I've seen this as well. |
@rohit21agrawal I finally had some time to look into this again, sorry for the delay. In my previous comment I said that B.DLL was copied to the build output directory, but Here's the summary of my problem with creating a nuget package. I hope someone can guide me to a solution (I renamed A and B to make it easier):
This problem is somewhat similar to #6614 -- my customer could start using the functionality in PrivateLib.DLL, but I cannot solve it the same way as #6614, because my PrivateLib.DLL is not and cannot be in a public nuget package. I tried creating an explicit assembly reference to PublicLib.DLL in my .nuspec file. Unfortunately, this doesn't just prevent an automatic assembly reference to PrivateLib.DLL, it also completely ignores PrivateLib.DLL -- even if I get this DLL into the nuget Is this possible? Perhaps if not with nuget/nuspec/csproj settings, are there any other ways to accomplish this? |
I can't figure out how the NuSpec
<references>
element maps to a csproj or MSBuild property. I believe it is because this mapping was omitted. The following articles:https://docs.microsoft.com/en-us/nuget/reference/msbuild-targets#pack-target
https://docs.microsoft.com/en-us/dotnet/core/tools/csproj#nuget-metadata-properties
fail to mention this.
Please let me know how to specify an explicit assembly reference for the pack target in a csproj file, explain why this capability does not exist, or use this issue to implement the mapping. Thank you.
The text was updated successfully, but these errors were encountered: