Skip to content

AppendTargetFrameworkToOutputPath not respected by PackageFile target #105

Description

@jzabroski

Describe the Bug

AppendTargetFrameworkToOutputPath not respected by PackageFile target, such that the output from dotnet nugetize custom.csproj is as follows:

Package: Custom.0.0.0.1-dev.nupkg
         D:\Users\John.Zabroski\source\infrastructure\trunk\Prototype\bin\Custom.nuspec
    Authors    : John.Zabroski
    Copyright  : Simmaculate c 2021
    Description: Package Description
    Icon       : icon.png
    Version    : 0.0.0.1-dev
  Contents:
    /contentFiles/
      any/
        net5.0/
          ThirdParty.OData

Steps to Reproduce

I don't know how to provide a unit test for MSBuild related stuff.

<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
  <!-- ReSharper disable UnknownProperty -->  
  <PropertyGroup>
    <Authors>John Zabroski</Authors>
    <Copyright>Simmaculate</Copyright>
    <TargetFramework>net5.0</TargetFramework> <!--netcoreapp2.1, netcoreapp3.1 also supported -->
    <EnablePackInference>false</EnablePackInference>
    <PackageIcon>icon.png</PackageIcon>
    <PackageId>Custom</PackageId>
    <AssemblyTitle>Custom Packaging</AssemblyTitle>
    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
    <OutputPath>bin</OutputPath>
  </PropertyGroup>

  <PropertyGroup>
    <PackDependencies>true</PackDependencies>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Nugetizer" Version="*" />
    <PackageReference Include="ThirdParty.OData" Version="*" >
      <PrivateAssets>all</PrivateAssets>
    </PackageReference>
  </ItemGroup>

  <ItemGroup>
    <PackageFile Include="ThirdParty.OData" Version="*" PackFolder="Content" Pack="true" />
  </ItemGroup>

</Project>

Expected Behavior

Based on AppendTargetFrameworkToOutputPath=false and PackDependencies=true and OutputPath=bin, I would expect the third party nuget package to be transcluded into the bin folder, and the /any/net5.0 sub-tree to be deforested so that its just "/contentFiles/".

Exception with Stack Trace

n/a

Version Info

dotnet-nugetize 0.7, Nugetizer 0.7

Additional Info

I figured I would use this prototype as research into @kzu suggesting I give Nugetizer a try to solve problems with SDK Pack, but so far I am not fully wrapping my head around how this is supposed to work, and I am most definitely not an MSBuild or Nuget expert.

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