Skip to content

Commit f81a256

Browse files
committed
Added new sample web project
1 parent 4326195 commit f81a256

File tree

7 files changed

+127
-0
lines changed

7 files changed

+127
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netcoreapp2.2</TargetFramework>
5+
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<PackageReference Include="Microsoft.AspNetCore.App" />
10+
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
11+
</ItemGroup>
12+
13+
</Project>

src/AutofacExamples.Web/Program.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.IO;
4+
using System.Linq;
5+
using System.Threading.Tasks;
6+
using Microsoft.AspNetCore;
7+
using Microsoft.AspNetCore.Hosting;
8+
using Microsoft.Extensions.Configuration;
9+
using Microsoft.Extensions.Logging;
10+
11+
namespace AutofacExamples.Web
12+
{
13+
public class Program
14+
{
15+
public static void Main(string[] args)
16+
{
17+
CreateWebHostBuilder(args).Build().Run();
18+
}
19+
20+
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
21+
WebHost.CreateDefaultBuilder(args)
22+
.UseStartup<Startup>();
23+
}
24+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"iisSettings": {
3+
"windowsAuthentication": false,
4+
"anonymousAuthentication": true,
5+
"iisExpress": {
6+
"applicationUrl": "http://localhost:63794",
7+
"sslPort": 44399
8+
}
9+
},
10+
"profiles": {
11+
"IIS Express": {
12+
"commandName": "IISExpress",
13+
"launchBrowser": true,
14+
"environmentVariables": {
15+
"ASPNETCORE_ENVIRONMENT": "Development"
16+
}
17+
},
18+
"AutofacExamples.Web": {
19+
"commandName": "Project",
20+
"launchBrowser": true,
21+
"applicationUrl": "https://localhost:5001;http://localhost:5000",
22+
"environmentVariables": {
23+
"ASPNETCORE_ENVIRONMENT": "Development"
24+
}
25+
}
26+
}
27+
}

src/AutofacExamples.Web/Startup.cs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using Microsoft.AspNetCore.Builder;
6+
using Microsoft.AspNetCore.Hosting;
7+
using Microsoft.AspNetCore.Http;
8+
using Microsoft.Extensions.DependencyInjection;
9+
10+
namespace AutofacExamples.Web
11+
{
12+
public class Startup
13+
{
14+
// This method gets called by the runtime. Use this method to add services to the container.
15+
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
16+
public void ConfigureServices(IServiceCollection services)
17+
{
18+
}
19+
20+
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
21+
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
22+
{
23+
if (env.IsDevelopment())
24+
{
25+
app.UseDeveloperExceptionPage();
26+
}
27+
28+
app.Run(async (context) =>
29+
{
30+
await context.Response.WriteAsync("Hello World!");
31+
});
32+
}
33+
}
34+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Debug",
5+
"System": "Information",
6+
"Microsoft": "Information"
7+
}
8+
}
9+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Warning"
5+
}
6+
},
7+
"AllowedHosts": "*"
8+
}

src/AutofacExamples.sln

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,19 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 15
44
VisualStudioVersion = 15.0.28307.489
55
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutofacExamples.Web", "AutofacExamples.Web\AutofacExamples.Web.csproj", "{005E4E3D-9358-481A-91F0-9EA4FB7C50D8}"
7+
EndProject
68
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{005E4E3D-9358-481A-91F0-9EA4FB7C50D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{005E4E3D-9358-481A-91F0-9EA4FB7C50D8}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{005E4E3D-9358-481A-91F0-9EA4FB7C50D8}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{005E4E3D-9358-481A-91F0-9EA4FB7C50D8}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
719
GlobalSection(SolutionProperties) = preSolution
820
HideSolutionNode = FALSE
921
EndGlobalSection

0 commit comments

Comments
 (0)