Skip to content

dotnet publish creating wrong executable name #1396

@sandyarmstrong

Description

@sandyarmstrong

Tested on OS X 10.12.5 with .NET Core 2.0.0-preview2-006497.

Steps to reproduce

  1. mkdir PublishTest.WithDot && cd PublishTest.WithDot (must be a dotted name to exhibit bug)
  2. dotnet new console
  3. Add <RuntimeIdentifiers>win-x64;osx.10.11-x64</RuntimeIdentifiers> in the default PropertyGroup in the generated csproj.
  4. dotnet build && dotnet publish -r osx.10.11-x64
  5. ls bin/Debug/netcoreapp2.0/osx.10.11-x64/publish/PublishTest.WithDot*

Expected Results

bin/Debug/netcoreapp2.0/osx.10.11-x64/publish/PublishTest.WithDot
bin/Debug/netcoreapp2.0/osx.10.11-x64/publish/PublishTest.WithDot.deps.json
bin/Debug/netcoreapp2.0/osx.10.11-x64/publish/PublishTest.WithDot.dll
bin/Debug/netcoreapp2.0/osx.10.11-x64/publish/PublishTest.WithDot.pdb
bin/Debug/netcoreapp2.0/osx.10.11-x64/publish/PublishTest.WithDot.runtimeconfig.json

Actual Results

bin/Debug/netcoreapp2.0/osx.10.11-x64/publish/PublishTest.WithDot.WithDot
bin/Debug/netcoreapp2.0/osx.10.11-x64/publish/PublishTest.WithDot.deps.json
bin/Debug/netcoreapp2.0/osx.10.11-x64/publish/PublishTest.WithDot.dll
bin/Debug/netcoreapp2.0/osx.10.11-x64/publish/PublishTest.WithDot.pdb
bin/Debug/netcoreapp2.0/osx.10.11-x64/publish/PublishTest.WithDot.runtimeconfig.json

The incorrectly-named executable does not work until it is renamed:

$ cd bin/Debug/netcoreapp2.0/osx.10.11-x64/publish

$ chmod +x PublishTest.WithDot.WithDot

$ ./PublishTest.WithDot.WithDot
The managed DLL bound to this executable: 'PublishTest.WithDot.dll', did not match own name 'PublishTest.WithDot.WithDot.dll'.
A fatal error was encountered. This executable was not bound to load a managed DLL.

$ mv PublishTest.WithDot.WithDot PublishTest.WithDot

$ ./PublishTest.WithDot
Hello World!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions