The executable generated from `dotnet publish -r linux-x64` doesn't have "x" permission
See original GitHub issueRelated issues:
- https://github.com/NuGet/Home/issues/4424#issuecomment-307479450
- https://github.com/dotnet/cli/issues/6286
Repro steps:
- Install this CLI on a Linux VM(mine was Ubuntu 16.04 LTS): https://dotnetcli.azureedge.net/dotnet/Sdk/2.0.0-preview2-006391/dotnet-sdk-2.0.0-preview2-006391-linux-x64.tar.gz
- mkdir testconsole
- cd testconsole
- Add a
NuGet.config
with the following content:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="DotNetCore" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>
- dotnet new console
- Open the testconsole.csproj file and add the property
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
and save the file - dotnet restore
- dotnet publish -r linux-x64
- cd to the published directory
- Run
./testconsole
Expected:
Hello World!
Actual: bash: ./testconsole: Permission denied
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (9 by maintainers)
Top Results From Across the Web
dotnet publish osx-x64 doesn't generate executable
I tried dotnet "filename" and it told me it wasn't signed and wouldn't let me run it. The posts I read on Avalonia...
Read more >dotnet publish command - .NET CLI
dotnet publish - Publishes the application and its dependencies to a folder for deployment to a hosting system.
Read more >Running a self-contained ASP.NET Core application on ...
Publish your application as a self contained application: dotnet publish -c release -r ubuntu. · Copy the publish folder to the Ubuntu machine....
Read more >Publishing to Linux Weirdness
I'm building on Windows 10. If I publish from the Build menu in Visual Studio 2019, then the main executable is marked as...
Read more >Self-contained executable with .NET Core 3.0 on Windows ...
I built “Hello, World” console application with the following command. sudo dotnet publish -r linux-x64 -c Release. It is published to same ...
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 Free
Top 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
I can confirm the repro steps (Ubuntu 14)
The workarounds for now:
chmod +x testconsole
ordotnet testconsole.dll
instead of testconsole directlyI’ll start working on the fix.
@steveharter fixed my issue! thank you!