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?}"
);
});
}