dotnet pack always failed on Ubuntu-18.04 with dotnet-sdk-3.0-preview3
See original GitHub issueOverview
dotnet pack
command always failed in Ubuntu-18.04 in dotnet-sdk-3.0-preview3.
if dotnet-sdk-2.2 was used, it successed.
Environment
platform is ubuntu-18.04-x64(created from azure virtual machine)
here is my dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 3.0.100-preview3-010431
Commit: d72abce213
Runtime Environment:
OS Name: ubuntu
OS Version: 18.04
OS Platform: Linux
RID: ubuntu.18.04-x64
Base Path: /home/itn/dotnet/sdk/3.0.100-preview3-010431/
Host (useful for support):
Version: 3.0.0-preview3-27503-5
Commit: 3844df9537
.NET Core SDKs installed:
3.0.100-preview3-010431 [/home/itn/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.0.0-preview3-19153-02 [/home/itn/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.0.0-preview3-27503-5 [/home/itn/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Steps to reproduce
- download dotnet-sdk-3.0-preview3 for linux-x64 from SDK’s download page
- extract archive to directory(
$HOME/dotnet
) - add
$HOME/dotnet
to$PATH
env - run
dotnet new classlib --name test1
- change directory to test1
- change
TargetFramework
tonetstandard2.1
- run
dotnet pack
Expected Behavior
test1.nupkg was created in bin
directory.
Actual Behavior
failed to create nupkg with following error message.
/home/itn/dotnet/sdk/3.0.100-preview3-010431/Sdks/NuGet.Build.Tasks.Pack/build/NuGet.Build.Tasks.Pack.targets(199,5): error NU5019: File not found: '/home/itn/test1/bin/Debug/netstandard2.1/test1.dll'. [/home/itn/test1/test1.csproj]
/home/itn/test1/bin/Debug/netstandard2.1/test1.dll
was created successfuly.
I also tried to change TargetFramework
to netstandard2.0
, but did not success.
Issue Analytics
- State:
- Created 5 years ago
- Comments:17 (7 by maintainers)
Top Results From Across the Web
dotnet pack recently failing
In our case, the error was due to multiple dependent nuget packages that all contained a .targets file with an element as this...
Read more >Cannot install .NET Core on Ubuntu Bionic Beaver
I'm currently trying to install .NET Core on Ubuntu 18.04 following these instructions. But I always get the following message: me@mine-Ubuntu ...
Read more >dotnet pack command - .NET CLI
The dotnet pack command creates NuGet packages for your .NET project. ... The build can also fail if there is a locked file...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As pointed out by @stephentoub, the issue can be solved by manually setting the
LANG
environment variable.Okay, this is funny, but I have nailed down the issue. It’s a bug in
System.Text.RegularExpressions
on WSL.The applicaiton
Output on vanilla Ubuntu 18.04
Output on WSL Ubuntu 18.04
Removing
RegexOptions.IgnoreCase
option fixes the output on WSL as well.Why this affects
dotnet pack
NuGet is filtering files by the
exclude
parameter usingRegex
here:Which results into file not found exceptions, since no files pass the regex filter.
Apart of fixing the regex issue, NuGet shall not throw
FileNotFound
exception if the file exists, but filtered out by the exclusions.