Specifying package path doesn't work with dotnet pack #4321

Closed
natemcmaster opened this Issue Jan 18, 2017 · 4 comments

Comments

Projects
None yet
5 participants
@natemcmaster

Repro
Use: dotnet-cli 1.0.0-rc3-004517

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp1.0</TargetFramework>
    <AssemblyName>dotnet-my-command</AssemblyName>
    <PackageType>DotnetCliTool</PackageType>
  </PropertyGroup>

  <ItemGroup>
      <None Include="$(ProjectRuntimeConfigFilePath)" Pack="true" PackagePath="lib/$(TargetFramework)/$(ProjectRuntimeConfigFileName)" />
  </ItemGroup>

</Project>

Run: dotnet pack

Expected

To satisfy requirements of dotnet-CLI tools, package layout must be:

lib/
    netcoreapp1.0/
        dotnet-my-command.dll
        dotnet-my-command.runtimeconfig.json

Actual
PackTask fails with:

System.Exception: Target path 'C:\Users\namc\AppData\Local\Temp\clitool\bin\Debug\netcoreapp1.0\dotnet-my-command.runtimeconfig.json' contains invalid characters.

Full stack trace:

C:\Users\namc\AppData\Local\Microsoft\dotnet\sdk\1.0.0-rc3-004517\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(89,5): error MSB4018: The "PackTask" task failed unexpectedly.\r [C:\Users\namc\AppData\Local\Temp\clitool\clitool.csproj]
C:\Users\namc\AppData\Local\Microsoft\dotnet\sdk\1.0.0-rc3-004517\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(89,5): error MSB4018: System.Exception: Target path 'C:\Users\namc\AppData\Local\Temp\clitool\bin\Debug\netcoreapp1.0\dotnet-my-command.runtimeconfig.json' contains invalid characters.\r [C:\Users\namc\AppData\Local\Temp\clitool\clitool.csproj]
C:\Users\namc\AppData\Local\Microsoft\dotnet\sdk\1.0.0-rc3-004517\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(89,5): error MSB4018:    at NuGet.Packaging.Manifest.Validate(Manifest manifest)\r [C:\Users\namc\AppData\Local\Temp\clitool\clitool.csproj]
C:\Users\namc\AppData\Local\Microsoft\dotnet\sdk\1.0.0-rc3-004517\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(89,5): error MSB4018:    at NuGet.Packaging.Manifest.Save(Stream stream, Boolean validate, Int32 minimumManifestVersion)\r [C:\Users\namc\AppData\Local\Temp\clitool\clitool.csproj]
C:\Users\namc\AppData\Local\Microsoft\dotnet\sdk\1.0.0-rc3-004517\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(89,5): error MSB4018:    at NuGet.Packaging.Manifest.Save(Stream stream)\r [C:\Users\namc\AppData\Local\Temp\clitool\clitool.csproj]
C:\Users\namc\AppData\Local\Microsoft\dotnet\sdk\1.0.0-rc3-004517\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(89,5): error MSB4018:    at NuGet.Commands.MSBuildProjectFactory.CreateBuilder(String basePath, NuGetVersion version, String suffix, Boolean buildIfNeeded, PackageBuilder builder)\r [C:\Users\namc\AppData\Local\Temp\clitool\clitool.csproj]
C:\Users\namc\AppData\Local\Microsoft\dotnet\sdk\1.0.0-rc3-004517\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(89,5): error MSB4018:    at NuGet.Commands.PackCommandRunner.BuildFromProjectFile(String path)\r [C:\Users\namc\AppData\Local\Temp\clitool\clitool.csproj]
C:\Users\namc\AppData\Local\Microsoft\dotnet\sdk\1.0.0-rc3-004517\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(89,5): error MSB4018:    at NuGet.Commands.PackCommandRunner.BuildPackage(String path)\r [C:\Users\namc\AppData\Local\Temp\clitool\clitool.csproj]
C:\Users\namc\AppData\Local\Microsoft\dotnet\sdk\1.0.0-rc3-004517\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(89,5): error MSB4018:    at NuGet.Commands.PackCommandRunner.BuildPackage()\r [C:\Users\namc\AppData\Local\Temp\clitool\clitool.csproj]
C:\Users\namc\AppData\Local\Microsoft\dotnet\sdk\1.0.0-rc3-004517\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(89,5): error MSB4018:    at NuGet.Build.Tasks.Pack.PackTask.Execute()\r [C:\Users\namc\AppData\Local\Temp\clitool\clitool.csproj]
C:\Users\namc\AppData\Local\Microsoft\dotnet\sdk\1.0.0-rc3-004517\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(89,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()\r [C:\Users\namc\AppData\Local\Temp\clitool\clitool.csproj]
C:\Users\namc\AppData\Local\Microsoft\dotnet\sdk\1.0.0-rc3-004517\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(89,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__25.MoveNext() [C:\Users\namc\AppData\Local\Temp\clitool\clitool.csproj]
@natemcmaster

This comment has been minimized.

Show comment
Hide comment
@natemcmaster

natemcmaster Jan 18, 2017

cc @rohit21agrawal this is very important. We are blocked on moving aspnet tools to RC3 by this.

cc @rohit21agrawal this is very important. We are blocked on moving aspnet tools to RC3 by this.

@muratg

This comment has been minimized.

Show comment
Hide comment
Member

muratg commented Jan 18, 2017

@NTaylorMullen NTaylorMullen referenced this issue in aspnet/Mvc Jan 18, 2017

Closed

[Tracker] MSBuild conversion issues #5482

36 of 55 tasks complete

@rohit21agrawal rohit21agrawal self-assigned this Jan 18, 2017

@rohit21agrawal rohit21agrawal added this to the 4.0 RTM milestone Jan 18, 2017

@natemcmaster natemcmaster referenced this issue in aspnet/Scaffolding Jan 19, 2017

Closed

Solution crashes VS 2017 RC3 #381

@rohit21agrawal rohit21agrawal changed the title from Cannot package a .NET Core CLI tool to Specifying package path doesn't work with dotnet pack Jan 19, 2017

@natemcmaster natemcmaster referenced this issue in aspnet/KoreBuild Jan 19, 2017

Closed

[Tracker] Workaround MSBuild bugs #150

14 of 16 tasks complete

@natemcmaster natemcmaster referenced this issue in aspnet/Scaffolding Jan 20, 2017

Merged

Upgrade to VS2017 RC.3 #387

@danroth27

This comment has been minimized.

Show comment
Hide comment
@danroth27

danroth27 Jan 24, 2017

Has this fix made it into the CLI yet? I'm still seeing this issue even with the latest CLI builds.

Has this fix made it into the CLI yet? I'm still seeing this issue even with the latest CLI builds.

@rohit21agrawal

This comment has been minimized.

Show comment
Hide comment
@rohit21agrawal

rohit21agrawal Jan 24, 2017

Contributor

@danroth27 not yet. but i can tell you a way to patch your CLI to get this fix if you'd like

Contributor

rohit21agrawal commented Jan 24, 2017

@danroth27 not yet. but i can tell you a way to patch your CLI to get this fix if you'd like

@natemcmaster natemcmaster referenced this issue in aspnet/Common Jan 31, 2017

Merged

Simplify packing #186

@nil4 nil4 referenced this issue in nil4/dotnet-transform-xdt Feb 2, 2017

Closed

Remove .runtimeconfig.json pack workaround #3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment