1

I've recently just upgraded Visual Studio 2015 with ASP.NET 5 beta8, which causes the strange shift from the old listener over to this new 'Kestrel' .. thing.

I've attempted to follow the instructions and get it to run, but I simply yield a console window that says...

Hosting environment: Development

Now listening on: http://localhost:5000

Application started. Press Ctrl+C to shut down.

Okay, so I navigate to http://localhost:5000, and ... nothing is there. My application doesn't run or anything.

I have tried to launch the default ASP.NET MVC sample project using Kestrel too, with the built in settings, and get the same result. I'm really unsure of what to do.

Here is what I've done so far...

I have it in my project.json file;

"dependencies": {
    "Microsoft.AspNet.Server.Kestrel": "1.0.0-beta8",
},

"commands": {
   "web": "Microsoft.AspNet.Server.Kestrel"
},

My program was working fine on beta7, using the old listener; But now even that doesn't work suddenly since installing beta8. I'm at the hair-pulling stage of frustration over this forced change. I can't get it to run in IIS either.

Per request, this is my Startup.cs file;

public Startup(IHostingEnvironment env, IApplicationEnvironment appEnv) {
    // Setup configuration sources.

    Configuration = new ConfigurationBuilder()
        .SetBasePath(appEnv.ApplicationBasePath)
        .AddJsonFile("config.json")
        .AddEnvironmentVariables()
        .Build();
}

public IConfiguration Configuration { get; set; }

// For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=398940
public void ConfigureServices(IServiceCollection services) {
    // Add MVC services to the services container.
    services.AddMvc();

    services.UseCookieAuthentication(o => {
        //o.ExpireTimeSpan
        o.CookieName = "3b7eaa9c-decd-4c5d-83f9-01f1f11a6e22";
    });
}

public void Configure(IApplicationBuilder app) {

    app.UseIdentity();
    app.UseStaticFiles();
    app.UseMvc(routes => {
        // add the new route here.
        routes.MapRoute(name: "areaRoute",
            template: "{area:exists}/{controller}/{action}");

        routes.MapRoute(
            name: "default",
            template: "{controller=Home}/{action=Index}/{id?}"
        );
    });
}
DavidG
  • 113,891
  • 12
  • 217
  • 223
Ciel
  • 4,290
  • 8
  • 51
  • 110
  • Please show your Startup.cs and did you create web.config with httpplatformhanler ? – Stas Boyarincev Nov 11 '15 at 07:43
  • I thought the web.config was only for running it in IIS? – Ciel Nov 11 '15 at 10:18
  • 1
    "I thought the web.config was only for running it in IIS?" Yes – Stas Boyarincev Nov 11 '15 at 10:50
  • Alright, I thought this ..'Kestrel' thing was a standalone thing, like the old WebListener. Is it actually part of IIS? The information on the Visual Studio website didn't make it seem that way, and the built-in ASP.NET samples don't include a web config. http://blogs.msdn.com/b/webdev/archive/2015/10/15/announcing-availability-of-asp-net-5-beta8.aspx – Ciel Nov 11 '15 at 10:54
  • Alright, I added my `Startup.cs` file to the question. – Ciel Nov 11 '15 at 10:56
  • 1
    Some info about new Hosting model may read [this](https://github.com/aspnet/Hosting/issues/364#issuecomment-148567294). I suggest you add logging in your application: – Stas Boyarincev Nov 11 '15 at 11:05
  • 1
    I suggest you add logging in your application: `loggerFactory.AddConsole(LogLevel.Debug)`, [see example](https://github.com/boyarincev/GetHabitsAspNet5/blob/master/src/GetHabitsAspNet5App/Startup.cs) and see what occur in logs. – Stas Boyarincev Nov 11 '15 at 11:10
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/94794/discussion-between-boyarincev-and-ciel). – Stas Boyarincev Nov 11 '15 at 11:13
  • Also note http://stackoverflow.com/questions/33235257/iis-deployed-asp-net-5-beta-8-site-to-iis-gives-http-error-500-19-internal-ser/33237948#33237948 If you are using IIS and not IIS Express you have to install the HTTPPlatformHandler – devfric Nov 11 '15 at 12:32
  • Thank you, @Boyarincev for all of your help. After the things we did, it turned out to be a problem with a specific version of a library that was getting cached and not updating. – Ciel Nov 11 '15 at 13:12
  • Hey @Boyarincev, can you post your stuff as an official answer so I can finally award credit? – Ciel Nov 29 '15 at 10:11
  • Hello @Ciel, thank you very much for your concern! – Stas Boyarincev Nov 29 '15 at 22:28

1 Answers1

1

That understand in which place the request pipeline problem arise, enable logging in your application.

Stas Boyarincev
  • 3,690
  • 23
  • 23
  • The problem was solved by logging and discovering that some libraries were not getting updated properly, yes! – Ciel Dec 01 '15 at 01:05