Sdk: [csproj] dotnet publish does not copy "contentFiles" to output.

Created on 11 Nov 2016  路  2Comments  路  Source: dotnet/sdk

Moved from https://github.com/dotnet/cli/issues/4553 on behalf of @chuckries.


This seems to be related to project.json -> csproj migration.

Steps to reproduce

  1. mkdir scratch
  2. cd scratch
  3. dotnet new
  4. open scratch.csproj and add the following snippet below the existing package reference ItemGroup:

    <PropertyGroup>
        <RuntimeIdentifiers>win7-x64</RuntimeIdentifiers>
        <PackageTargetFallback>dnxcore50;portable-net45+win8</PackageTargetFallback>
    </PropertyGroup>
    
    <ItemGroup>
      <PackageReference Include="Microsoft.VisualStudio.clrdbg.MIEngine">
        <Version>14.0.31028-preview-1</Version>
      </PackageReference>
    </ItemGroup>
    
  5. dotnet restore
  6. dotnet publish -r win7-x64 -o publish

Expected behavior

The published directory contains these files from the Microsoft.VisualStudio.clrdbg.MIEngine package:

  • Microsoft.MICore.dll
  • Microsoft.MIDebugEngine.dll
  • coreclr.ad7Engine.json
  • osxlaunchhelper.scpt

Actual behavior

The published directory does not contain coreclr.ad7Engine.json or osxlaunchelper.scpt

Additional Info

Attempting to do this same publish against the following project.json works with older CLI's:

{
  "name": "dummy",
  "buildOptions": {
    "emitEntryPoint": true
  },
  "dependencies": {
    "Microsoft.VisualStudio.clrdbg.MIEngine": "14.0.30822-preview-1",
  },
  "frameworks": {
    "netcoreapp1.0": {
      "dependencies": {
        "Microsoft.NETCore.App": {
          "type": "platform",
          "version": "1.0.0"
        }
      },
      "imports": [
        "dnxcore50",
        "portable-net45+win8"
      ]
    }
  },
  "runtimes": {
    "win7-x64": {}
  }
}

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-preview3-003933)

Product Information:
 Version:            1.0.0-preview3-003933
 Commit SHA-1 hash:  6fcbefa4f7

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.14393
 OS Platform: Windows
 RID:         win10-x86
Bug Urgency-Soon release blocking

Most helpful comment

Now that NuGet generates the items for content files in the generated NuGet.g.props, this scenario just works. Verified on the latest CLI that coreclr.ad7Engine.json and osxlaunchhelper.scpt do get dropped into the publish folder.

All 2 comments

Now that NuGet generates the items for content files in the generated NuGet.g.props, this scenario just works. Verified on the latest CLI that coreclr.ad7Engine.json and osxlaunchhelper.scpt do get dropped into the publish folder.

Thanks!

Was this page helpful?
0 / 5 - 0 ratings