Launching ASP.NET Core 1 app from console application
<p>While dotnet cli is not yet ready to work with Visual Studio and dnu/dnx gives me huge amount of extra unneeded libraries I want to do the following.</p>

<p>I want to launch ASP.NET Core 1 project either using command line or console app using traditional .csproj approach.
I created a ASP.NET 4 project, included all dependencies and was able to compile it.</p>

<p>1st Attempt.
At first I tried to compile it into console app and launch through standard entry point:</p>

<pre><code>    // Entry point for the application.
    public static void Main(string[] args) {
        WebApplication.Run&lt;Startup&gt;(args);
    }
</code></pre>

<p>It says: "No service for type 'Microsoft.Extensions.PlatformAbstractions.IApplicationEnvironment' has been registered."</p>

<p>Which means that dnx.exe creates additional dependency injection rules probably through PlatformServices.Create. 
Does somebody know how to do it properly?</p>

<p>2nd Attempt
I compiled it into dll and tried to launch it through dnx.exe which gave me the error "Error: Unable to load application or execute command 'Microsoft.AspNet.Hosting'. Available commands: web.".</p>

<p>Here's my project.json:</p>

<pre><code>{
  "version": "1.0.0-*",
  "compilationOptions": {
    "emitEntryPoint": true
  },
  "webroot": "wwwroot",
  "commands": {
    "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls http://*:5004"
  },
  "frameworks": {
    "dnx451": {}
  },
  "entryPoint": "ManagementConsoleWeb",
  "loadable": false
}
</code></pre>

<p>So what's the proper way? Is is possible at all?</p>