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.

The executable generated from `dotnet publish -r linux-x64` doesn't have "x" permission

See original GitHub issue

Related issues:

Repro steps:

<?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

cc @steveharter @gkhanna79

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
stevehartercommented, Jun 12, 2017

I can confirm the repro steps (Ubuntu 14)

The workarounds for now:

  • Manually perform a chmod +x testconsole or
  • Run via dotnet testconsole.dll instead of testconsole directly

I’ll start working on the fix.

0reactions
sayhicoelhocommented, Dec 14, 2018
  • Manually perform a chmod +x testconsole

@steveharter fixed my issue! thank you!

Read more comments on GitHub >

github_iconTop 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 >

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