ASP.NET Core - hello world

Hello world

Hier ein vollständiges und minimales Beispiel, wie eine simple Hello World Anwendung in ASP.NET Core 1 aussehen kann:

 1using System;
 2using System.Collections.Generic;
 3using System.Linq;
 4using System.Threading.Tasks;
 5using Microsoft.AspNetCore.Builder;
 6using Microsoft.AspNetCore.Hosting;
 7using Microsoft.AspNetCore.Http;
 8using Microsoft.Extensions.DependencyInjection;
 9using Microsoft.Extensions.Logging;
10
11namespace AspNetCore_Basics_HelloWorld
12{
13    public class Program
14    {
15        public static void Main(string[] args)
16        {
17            var host = new WebHostBuilder()
18                .UseKestrel()
19                .UseStartup<Startup>()
20                .Build();
21
22            host.Run();
23        }
24    }
25
26    public class Startup
27    {
28        public void ConfigureServices(IServiceCollection services)
29        {
30        }
31        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory lf)
32        {
33            loggerFactory.AddConsole();
34
35            if (env.IsDevelopment())
36            {
37                app.UseDeveloperExceptionPage();
38            }
39
40            app.Run(async (context) =>
41            {
42                await context.Response.WriteAsync("Hello World!");
43            });
44        }
45    }
46}
Eine moderne WebAPI - die OData Basics

Feb 03, 2016 - 16 min read

Eine moderne WebAPI - die OData Basics

Was ist OData? Doch zunächst etwas Vorgeschichte Seit es Schnittstellen (API) zum Austausch von Daten gibt, gibt es die Unsicherheit, welche …

IIS und ASP.NET Header verstecken

Mar 16, 2015 - 2 min read

IIS und ASP.NET Header verstecken

Nicht jeder möchte, dass jeder sehen kann, was für ein Webserver für die eigene Homepage verwendet wird. Dies sind bzw. können schließlich …


Let's Work Together

Looking for an experienced Platform Architect or Engineer for your next project? Whether it's cloud migration, platform modernization or building new solutions from scratch - I'm here to help you succeed.

New Platforms
Modernization
Training & Consulting