Я хочу перенести мою фреймворк в новое .net-ядро, поэтому я создал пустое приложение, добавил статический член, чтобы получить представление о поведении, увеличивать int на запрос, но он работает в два раза, один раз для запроса и один раз сразу после запроса, поэтому вместо того, чтобы 1,2,3,4 ... я получить 1,3,5,7 ...Почему код запуска DNX дважды
public class Startup
{
// This method gets called by the runtime. Use this method to add services to the container.
// For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=398940
public void ConfigureServices(IServiceCollection services)
{
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app)
{
app.UseIISPlatformHandler();
app.Run(async (context) =>
{
state++;
await context.Response.WriteAsync(state.ToString());
});
}
public static int state;
// Entry point for the application.
public static void Main(string[] args) => Microsoft.AspNet.Hosting.WebApplication.Run<Startup>(args);
}
Пятно на, что новичок на моей стороне :) – rizzle