Skip to content

Commit

Permalink
Add reflection and kestrel-minimal
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalStrehovsky committed May 5, 2024
1 parent ed4f80a commit 003ec65
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/sizestats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ jobs:
- hello-minimal
- webapiaot
- avalonia.app
- reflection
- kestrel-minimal
include:
- os: linux
osrid: linux
Expand Down
1 change: 0 additions & 1 deletion src/hello-minimal/hello-minimal.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>hello_minimal</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PublishAot>true</PublishAot>
Expand Down
8 changes: 8 additions & 0 deletions src/kestrel-minimal/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
var host = new WebHostBuilder()
.UseKestrelCore()
.Configure(app =>
{
app.Run(context => context.Response.WriteAsync("Hello World"));
})
.Build();
host.Run();
15 changes: 15 additions & 0 deletions src/kestrel-minimal/kestrel-minimal.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<InvariantGlobalization>true</InvariantGlobalization>
<PublishAot>true</PublishAot>
<OptimizationPreference>Size</OptimizationPreference>
<StackTraceSupport>false</StackTraceSupport>
<UseSystemResourceKeys>true</UseSystemResourceKeys>
<EventSourceSupport>false</EventSourceSupport>
</PropertyGroup>

</Project>
5 changes: 5 additions & 0 deletions src/reflection/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
using System;
using System.Reflection;
using System.Runtime.Versioning;

Console.WriteLine(typeof(object).Assembly.GetCustomAttribute<TargetFrameworkAttribute>().FrameworkDisplayName);
10 changes: 10 additions & 0 deletions src/reflection/reflection.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<PublishAot>true</PublishAot>
<InvariantGlobalization>true</InvariantGlobalization>
</PropertyGroup>

</Project>

0 comments on commit 003ec65

Please sign in to comment.