Skip to content
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

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

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

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

natemcmaster opened this issue Jan 18, 2017 · 4 comments

Comments

@natemcmaster
Copy link

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
Copy link
Author

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

@muratg
Copy link

muratg commented Jan 18, 2017

cc @rrelyea

@danroth27
Copy link

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

@rohit21agrawal
Copy link
Contributor

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

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

No branches or pull requests

5 participants