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.

Publishing standalone app with a dot '.' in name on linux generates executable in an unexpected way

See original GitHub issue

Steps to reproduce

  • On Ubuntu 16.04 LTS, install the latest version of CLI (I had 5825)
  • mkdir sample.webapi
  • cd sample.webapi
  • dotnet new webapi
  • Open the .csproj file and add a runtime identifier for linux-x64 <RuntimeIdentifiers>linux-x64</RuntimeIdentifiers> and save the file
  • Open the NuGet.config file and remove the dotnet-core feed as aspnetcore-dev would suffice here
  • dotnet restore
  • dotnet publish -r linux-x64

Expected behavior

The published output should have an executable with name sample.webapi

Actual behavior

An executable with name sample.webapi.webapi

Environment data

dotnet --info output:

.NET Command Line Tools (2.0.0-preview1-005825)

Product Information:
 Version:            2.0.0-preview1-005825
 Commit SHA-1 hash:  b4a821109d

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  16.04
 OS Platform: Linux
 RID:         ubuntu.16.04-x64
 Base Path:   /home/kiran/.dotnet/sdk/2.0.0-preview1-005825/

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0-preview1-002061-00
  Build    : 2b70ec9c3b014af0c2a5f45de0e5b73a1ae51c09

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:36 (20 by maintainers)

github_iconTop GitHub Comments

2reactions
dasMullicommented, Oct 24, 2018

@peterhuene any chance to get a fix into 2.2? It’s a bit sad that dotnet run doesn’t work when a RuntimeIdentifier is specified in the project file and there is a dot in the project name…

2reactions
dasMullicommented, Nov 30, 2017

@fbarletta as a workaround, could you add this to the project and test if it works?:

  <Target Name="FixRidSpecificHost" AfterTargets="_ComputeNETCoreBuildOutputFiles">
    <ItemGroup>
      <None Remove="@(NativeAppHostNETCore)" />
      <None Include="@(NativeAppHostNETCore)" Link="$(AssemblyName)" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="Never"/>
    </ItemGroup>
  </Target>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Running a self-contained ASP.NET Core application on ...
Run the executable. When you create a self-contained app, the publish output "contains the complete set of files (both your app files and ......
Read more >
Hide files in Linux without using the dot
Create a file .hidden in the directory with the names of the files to be hidden (one name each line). Then add the...
Read more >
What is the difference between running a executable just ...
When you run an executable file ( or rather in unix/linux world - a file with executable rights/flag on) like so : $...
Read more >
Containerize a .NET app with dotnet publish
In this tutorial, you'll learn how to containerize a .NET application with dotnet publish.
Read more >
Chef Infra Client (executable)
Chef Infra Client is an agent that runs locally on every node that is under management by Chef Infra Server.
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