using
Microsoft.AspNetCore.Builder;
Microsoft.AspNetCore.Hosting;
Microsoft.AspNetCore.Http;
Microsoft.Extensions.DependencyInjection;
Microsoft.Extensions.Logging;
namespace
StartupConfig
{
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
void
ConfigureServices(IServiceCollection services)
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
loggerFactory.AddConsole();
DefaultFilesOptions DefaultFile =
new
DefaultFilesOptions();
DefaultFile.DefaultFileNames.Clear();
DefaultFile.DefaultFileNames.Add(
"Welcome.html"
);
app.UseDefaultFiles(DefaultFile);
app.UseStaticFiles();
if
(env.IsDevelopment())
app.UseDeveloperExceptionPage();
app.Run(async (context) =>
await context.Response.WriteAsync(
"Hello World!"
});
"dependencies"
: {
"Microsoft.NETCore.App"
"version"
:
"1.0.1"
,
"type"
"platform"
},
"Microsoft.AspNetCore.Diagnostics"
"1.0.0"
"Microsoft.AspNetCore.Server.IISIntegration"
"Microsoft.AspNetCore.Server.Kestrel"
"Microsoft.Extensions.Logging.Console"
"Microsoft.AspNetCore.StaticFiles"
"1.1.1"
"tools"
"Microsoft.AspNetCore.Server.IISIntegration.Tools"
"1.0.0-preview2-final"
"frameworks"
"netcoreapp1.0"
"imports"
: [
"dotnet5.6"
"portable-net45+win8"
]
"buildOptions"
"emitEntryPoint"
true
"preserveCompilationContext"
"runtimeOptions"
"configProperties"
"System.GC.Server"
"publishOptions"
"include"
"wwwroot"
"web.config"
"scripts"
"postpublish"
"dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%"
You can download ASP.NET Core source code from the MSDN Code, using the links, mentioned below.
It's recommended to read more articles related to ASP.NET Core.