Skip to content

Several issues when packing a project referencing a multi-target project #97

Description

@tranb3r

Describe the Bug

When packing a single-target project that references a multi-target project, I'm facing 3 different issues that I'll try to describe here.
I'm a bit lost and I'd really appreciate some help. Thanks

Steps to Reproduce

TestNugetizer.zip

Open the repro TestNugetizer.zip and extract it. It contains 3 projects: LibA (a single-target project, references LibB) ; LibB (a mutli-target project) ; LibPackaging (a multi-target project, references LibA, and is used to build both LibA and LibB properly).

Go to the build folder, run clean.bat first, then pack.bat. There are 4 steps (clean, restore, build, pack). It should build all dlls and produce a TestNugetizer.1.0.0.nupkg file.

First issue: open the nupkg file ; the lib\monoandroid11.0\ folder should contain both LibA.dll and LibB.dll, but it's missing LibB.dll. The lib\netstandard2.1\ folder contains both libs, which is expected.

Second issue: open the nupkg file, and then the TestNugetizer.nuspec file. The Microsoft.Extensions.Http dependency is missing in the MonoAndroid11.0 targetFramework.

Third issue: the pack.bat produces the following error, which is weird:

NuGetizer.Shared.targets(277,5): error NG0012: Duplicate package source files with distinct content detected. Duplicates are not allowed in the package. Please remove the conflict between these files: 'D:\Dev\Temp\TestNugetizer\LibB\bin\Debug\netstandard2.1\LibB.dll' > 'lib\monoandroid11.0\LibB.dll' [D:\Dev\Temp\TestNugetize
r\LibPackaging\LibPackaging.csproj]
NuGetizer.Shared.targets(277,5): error NG0012: 'D:\Dev\Temp\TestNugetizer\LibB\bin\Debug\monoandroid11.0\LibB.dll' > 'lib\monoandroid11.0\LibB.dll' [D:\Dev\Temp\TestNugetizer\LibPackaging\LibPackaging.csproj]
NuGetizer.Shared.targets(277,5): error NG0012: 'D:\Dev\Temp\TestNugetizer\LibB\bin\Debug\netstandard2.1\LibB.pdb' > 'lib\monoandroid11.0\LibB.pdb' [D:\Dev\Temp\TestNugetizer\LibPackaging\LibPackaging.csproj]
NuGetizer.Shared.targets(277,5): error NG0012: 'D:\Dev\Temp\TestNugetizer\LibB\bin\Debug\monoandroid11.0\LibB.pdb' > 'lib\monoandroid11.0\LibB.pdb' [D:\Dev\Temp\TestNugetizer\LibPackaging\LibPackaging.csproj]

Version Info

Nugetizer 0.7.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions