question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot pack netcore project

See original GitHub issue

Description

As per the title 😃

Repro steps

git clone https://github.com/fable-compiler/Fable
cd Fable
git checkout 19ff181
cd src/dotnet/Fable.Compiler
dotnet restore
dotnet pack

Expected behavior

A .nupkg is created

Actual behavior

The command fails with the following error:

~/d/F/s/d/Fable.Compiler ❯❯❯ dotnet pack
Microsoft (R) Build Engine version 15.1.1012.6693
Copyright (C) Microsoft Corporation. All rights reserved.

  Fable.Core -> /Users/alfonsogarciacaronunez/dev/Fable/src/dotnet/Fable.Core/bin/Debug/netstandard1.6/Fable.Co
re.dll
  Fable.Compiler -> /Users/alfonsogarciacaronunez/dev/Fable/src/dotnet/Fable.Compiler/bin/Debug/netstandard1.6/
Fable.Compiler.dll
/Users/alfonsogarciacaronunez/dev/Fable/.paket/Paket.Restore.targets(89,5): error MSB4018: The "PackTask" taskfailed unexpectedly. [/Users/alfonsogarciacaronunez/dev/Fable/src/dotnet/Fable.Compiler/Fable.Compiler.fsproj]
/Users/alfonsogarciacaronunez/dev/Fable/.paket/Paket.Restore.targets(89,5): error MSB4018: System.IO.DirectoryNotFoundException: Could not find a part of the path '/Users/alfonsogarciacaronunez/dev/Fable/src/dotnet/Fable.Compiler/obj/Fable.Compiler.1.1.10.nuspec;/Users/alfonsogarciacaronunez/dev/Fable/src/dotnet/Fable.Compiler/obj'. [/Users/alfonsogarciacaronunez/dev/Fable/src/dotnet/Fable.Compiler/Fable.Compiler.fsproj]
/Users/alfonsogarciacaronunez/dev/Fable/.paket/Paket.Restore.targets(89,5): error MSB4018:    at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) [/Users/alfonsogarciacaronunez/dev/Fable/src/dotnet/Fable.Compiler/Fable.Compiler.fsproj]
/Users/alfonsogarciacaronunez/dev/Fable/.paket/Paket.Restore.targets(89,5): error MSB4018:    at Interop.CheckIo(Int64 result, String path, Boolean isDirectory, Func`2 errorRewriter) [/Users/alfonsogarciacaronunez/dev/Fable/src/dotnet/Fable.Compiler/Fable.Compiler.fsproj]
/Users/alfonsogarciacaronunez/dev/Fable/.paket/Paket.Restore.targets(89,5): error MSB4018:    at System.IO.UnixFileSystem.SetCurrentDirectory(String fullPath) [/Users/alfonsogarciacaronunez/dev/Fable/src/dotnet/Fable.Compiler/Fable.Compiler.fsproj]
/Users/alfonsogarciacaronunez/dev/Fable/.paket/Paket.Restore.targets(89,5): error MSB4018:    at System.IO.Directory.SetCurrentDirectory(String path) [/Users/alfonsogarciacaronunez/dev/Fable/src/dotnet/Fable.Compiler/Fable.Compiler.fsproj]
/Users/alfonsogarciacaronunez/dev/Fable/.paket/Paket.Restore.targets(89,5): error MSB4018:    at NuGet.Commands.PackCommandRunner.SetupCurrentDirectory(PackArgs packArgs) [/Users/alfonsogarciacaronunez/dev/Fable/src/dotnet/Fable.Compiler/Fable.Compiler.fsproj]
/Users/alfonsogarciacaronunez/dev/Fable/.paket/Paket.Restore.targets(89,5): error MSB4018:    at NuGet.Build.Tasks.Pack.PackTaskLogic.GetPackArgs(IPackTaskRequest`1 request) [/Users/alfonsogarciacaronunez/dev/Fable/src/dotnet/Fable.Compiler/Fable.Compiler.fsproj]
/Users/alfonsogarciacaronunez/dev/Fable/.paket/Paket.Restore.targets(89,5): error MSB4018:    at NuGet.Build.Tasks.Pack.PackTask.Execute() [/Users/alfonsogarciacaronunez/dev/Fable/src/dotnet/Fable.Compiler/Fable.Compiler.fsproj]
/Users/alfonsogarciacaronunez/dev/Fable/.paket/Paket.Restore.targets(89,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/Users/alfonsogarciacaronunez/dev/Fable/src/dotnet/Fable.Compiler/Fable.Compiler.fsproj]
/Users/alfonsogarciacaronunez/dev/Fable/.paket/Paket.Restore.targets(89,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__25.MoveNext() [/Users/alfonsogarciacaronunez/dev/Fable/src/dotnet/Fable.Compiler/Fable.Compiler.fsproj]

Known workarounds

Haven’t found any yet 😦

Paket 5.6.9 dotnet SDK 1.0.4 macOS 10.12.5

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
enricosadacommented, Jan 24, 2018

Closing, origin issue was fixed

I tried this and it seems that this command doesn’t generate dependency groups. @haf can you open a bug about this? is related to paket pack? afaik latest version with dotnet pack or msbuild /t:Pack works

1reaction
enricosadacommented, Jul 13, 2017

Some options:

Property .net core sdk 1.0 .net core sdk 2.0
NuGetToolVersion 4.0.0 4.3.0
BundledNETStandardTargetFrameworkVersion not set 2.0

afaik is better check NuGetToolVersion, i dont think will change with a minor update of sdk 1.0

that’s done just checking the props, like dotnet build -v diag > log.txt (or msbuild /t:Build /v:diag > log.txt) if can be useful later

for set it, usual Condition on prop

<UseNewPack Condition=" '$(NuGetToolVersion)' != '4.0.0' ">true</UseNewPack>
Read more comments on GitHub >

github_iconTop Results From Across the Web

dotnet pack creates package that is not compatible with . ...
I am creating a NuGet package which contains a .Net Standard DLL and a config file. This project is supposed to support both...
Read more >
dotnet pack command - .NET CLI
The dotnet pack command builds the project and creates NuGet packages. The result of this command is a NuGet package (that is, a...
Read more >
dotnet pack does not produce package on net core 2.0.0 ...
Steps to reproduce Install net core 2.0.0 sdk Create a basic Web project with net461 target framework and referencing AspNetCore 2.0.0 ...
Read more >
NETSDK1079: The Microsoft.AspNetCore.All package is ...
You retarget an ASP.NET Core project from .NET Core 2.2 or earlier to .NET Core 3.0 or later. The project uses the Microsoft.AspNetCore.All ......
Read more >
Build failing - Currently, 'dotnet pack' command does not ...
NET Core projects we recently enabled. Quick workaround for now is to disable/comment platform: Any CPU in your appveyor.yml . Meanwhile we are ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found