- Notifications
You must be signed in to change notification settings - Fork 1.4k
/
Copy pathProgram.cs
14 lines (12 loc) · 878 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
varapp=WebApplication.Create();
app.Run(async context =>
{
context.Response.Headers.Append("content-type","text/html");
awaitcontext.Response.WriteAsync($"Application Name: {System.Reflection.Assembly.GetEntryAssembly().GetName().Name}<br/>");
awaitcontext.Response.WriteAsync($"Application Base Path: {System.AppContext.BaseDirectory}<br/>");
System.Reflection.AssemblyentryAssembly=System.Reflection.Assembly.GetEntryAssembly();
vartargetFramework=entryAssembly.GetCustomAttributes(typeof(System.Runtime.Versioning.TargetFrameworkAttribute),true)[0]asSystem.Runtime.Versioning.TargetFrameworkAttribute;
awaitcontext.Response.WriteAsync($"Target Framework: {targetFramework.FrameworkName}<br/>");
awaitcontext.Response.WriteAsync($"Version: {System.Reflection.Assembly.GetEntryAssembly().GetName().Version}<br/>");
});
app.Run();