Sdk: There is no exe present in the output of `dotnet publish`.

Created on 14 Apr 2016  Â·  7Comments  Â·  Source: dotnet/sdk

Steps to reproduce

PowerShell

git clone https://github.com/aspnet/cli-samples.git
cd .\cli-samples\HelloWeb\
dnvm use 1.0.0-rc2-20221 -runtime coreclr -os win -architecture x64
dotnet restore
dotnet publish --output approot
dir .\approot\ -Filter *.exe

Expected behavior

C:\GitHub\cli-samples\HelloWeb [master ≡ +1 ~0 -0 !]> dir .\approot\ -Filter *.exe


    Directory: C:\GitHub\cli-samples\HelloWeb\approot


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----        4/13/2016   9:30 PM              0 HelloWeb.exe

Actual behavior

There is no .exe present.

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-rc2-002392)

Product Information:
 Version:     1.0.0-rc2-002392
 Commit Sha:  880dcf2fc8

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.10586
 OS Platform: Windows
 RID:         win10-x64

Most helpful comment

@shaunluttin That explains it ... I was looking in totally the wrong place. ... and woe! was this hard to find!!! .... https://github.com/blackdwarf/core-docs/blob/clidocs/docs/core-concepts/app-types.md

All 7 comments

Here is a workaround. This project.json did NOT work.

{                                                             
  "compilationOptions": {                                     
    "emitEntryPoint": true,                                   
    "debugType": "portable"                                   
  },                                                          
  "dependencies" : {                                          
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-*",  
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*",
    "Microsoft.NETCore.App": {                                
      "type": "platform",                                     
      "version": "1.0.0-rc2-23931"                            
    }                                                         
  },                                                          
  "frameworks": {                                             
    "netcoreapp1.0": {                                        
      "imports": [                                            
        "portable-net45+wp80+win8+wpa81+dnxcore50"            
      ]                                                       
    }                                                         
  },
  "content": [                                                
    "web.config"                                              
  ]                                                           
}                                                                                            

This project.json did work after two changes:

  • remove the dependency on Microsoft.NETCoreApp.
  • add the runtimes section.
{                                                             
  "compilationOptions": {                                     
    "emitEntryPoint": true,                                   
    "debugType": "portable"                                   
  },                                                          
  "dependencies" : {                                          
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-*",  
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*",
  },                                                          
  "frameworks": {                                             
    "netcoreapp1.0": {                                        
      "imports": [                                            
        "portable-net45+wp80+win8+wpa81+dnxcore50"            
      ]                                                       
    }                                                         
  },
    "runtimes": {                                                     
        "win10-x64": {}                                               
    },                                                                
  "content": [                                                
    "web.config"                                              
  ]                                                           
}                                                                      

@shaunluttin This is by-design. What you produced first was a shared framework application, so it's not supposed to have an executable, as the app's runtime will be installed on the host. Your mods ended up producing a self-contained standalone application (produced by removing the "type": "platform"bit and providing a runtime).

I'd give you the doc on the details but it's under development buried over there somewhere on a branch I think. /cc @blackdwarf wrote that I think and will know right where it is.

@GuardRex , agreed. We'll close this issue and hopefully @blackdwarf gets the doc out soon.

@Petermarcu sure, that doc about app types is in PR on dotnet/core-docs.

@shaunluttin That explains it ... I was looking in totally the wrong place. ... and woe! was this hard to find!!! .... https://github.com/blackdwarf/core-docs/blob/clidocs/docs/core-concepts/app-types.md

@GuardRex Its not merged yet. :) Wait a bit. :)

@blackdwarf :beers:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

joffreykern picture joffreykern  Â·  3Comments

davkean picture davkean  Â·  3Comments

natemcmaster picture natemcmaster  Â·  3Comments

dasMulli picture dasMulli  Â·  3Comments

noelitoa picture noelitoa  Â·  3Comments