Skip to content

Commit 74bc050

Browse files
author
Mihaela Blendea
committed
Add aks scripts
2 parents 13327f2 + 86587d2 commit 74bc050

18 files changed

Lines changed: 157 additions & 11503 deletions

File tree

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Microsoft.AspNetCore.Builder;
22
using Microsoft.AspNetCore.Hosting;
3+
using NLog;
34
using NLog.Web;
45
using System.IO;
56

@@ -9,15 +10,22 @@ public class Program
910
{
1011
public static void Main(string[] args)
1112
{
12-
var host = new WebHostBuilder()
13-
.UseKestrel()
14-
.UseContentRoot(Directory.GetCurrentDirectory())
15-
.UseIISIntegration()
16-
.UseNLog()
17-
.UseStartup<Startup>()
18-
.Build();
13+
NLogBuilder.ConfigureNLog("nlog.config");
14+
try
15+
{
16+
var host = new WebHostBuilder()
17+
.UseKestrel()
18+
.UseContentRoot(Directory.GetCurrentDirectory())
19+
.UseIISIntegration()
20+
.UseNLog()
21+
.UseStartup<Startup>()
22+
.Build();
1923

20-
host.Run();
24+
host.Run();
25+
} finally
26+
{
27+
LogManager.Shutdown();
28+
}
2129
}
2230
}
2331
}

samples/demos/belgrade-product-catalog-demo/Startup.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ public class Startup
2323
{
2424
public Startup(IHostingEnvironment env)
2525
{
26-
env.ConfigureNLog("nlog.config");
26+
// Deprecated way to initialize NLog form nlog.config, but works if you don't copy file to /bin.
27+
//env.ConfigureNLog("nlog.config");
2728

2829
var builder = new ConfigurationBuilder()
2930
.SetBasePath(env.ContentRootPath)
@@ -86,12 +87,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
8687
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
8788
loggerFactory.AddDebug();
8889
loggerFactory.AddSerilog();
89-
90-
//add NLog to ASP.NET Core
91-
loggerFactory.AddNLog();
92-
NLog.LogManager.ThrowExceptions = true;
93-
NLog.LogManager.ThrowConfigExceptions = true;
94-
90+
9591
app.UseSession();
9692
app.UseStaticFiles();
9793
app.UseMvc(routes =>

samples/demos/belgrade-product-catalog-demo/belgrade-product-catalog-demo.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,10 @@
6161
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
6262
</ItemGroup>
6363

64+
<ItemGroup>
65+
<Content Update="nlog.config">
66+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
67+
</Content>
68+
</ItemGroup>
69+
6470
</Project>

samples/features/json/reactjs/dotnet-comments-app/CommentsReactApp.xproj

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks>netcoreapp1.0;net46</TargetFrameworks>
5+
<PreserveCompilationContext>true</PreserveCompilationContext>
6+
<AssemblyName>dotnet-comments-app</AssemblyName>
7+
<OutputType>Exe</OutputType>
8+
<PackageId>dotnet-comments-app</PackageId>
9+
<RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">1.0.4</RuntimeFrameworkVersion>
10+
</PropertyGroup>
11+
12+
<ItemGroup>
13+
<None Update="wwwroot\**\*;Views">
14+
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
15+
</None>
16+
</ItemGroup>
17+
18+
<ItemGroup>
19+
<PackageReference Include="Belgrade.Sql.Client" Version="0.3.0" />
20+
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.0.3" />
21+
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.0.2" />
22+
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.0.3" />
23+
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.0.2" />
24+
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.0.2" />
25+
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="1.0.2" />
26+
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.0.2" />
27+
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.0.2" />
28+
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.0.2" />
29+
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.0.2" />
30+
<PackageReference Include="System.Data.SqlClient" Version="4.1.0" />
31+
</ItemGroup>
32+
33+
<ItemGroup Condition=" '$(TargetFramework)' == 'net46' ">
34+
<Reference Include="System" />
35+
<Reference Include="Microsoft.CSharp" />
36+
</ItemGroup>
37+
38+
</Project>

samples/features/json/reactjs/dotnet-comments-app/project.json

Lines changed: 0 additions & 53 deletions
This file was deleted.

samples/features/json/todo-app/dotnet-rest-api/TodoRestWebAPI.xproj

Lines changed: 0 additions & 19 deletions
This file was deleted.

samples/features/json/todo-app/dotnet-rest-api/appsettings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@
66
"System": "Information",
77
"Microsoft": "Information"
88
}
9+
},
10+
"ConnectionStrings": {
11+
"TodoDb": "Server=.\\SQLEXPRESS;Database=TodoDb;Integrated Security=True"
912
}
1013
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks>netcoreapp1.0;net46</TargetFrameworks>
5+
<PreserveCompilationContext>true</PreserveCompilationContext>
6+
<AssemblyName>dotnet-rest-api</AssemblyName>
7+
<OutputType>Exe</OutputType>
8+
<PackageId>dotnet-rest-api</PackageId>
9+
<RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">1.0.4</RuntimeFrameworkVersion>
10+
</PropertyGroup>
11+
12+
<ItemGroup>
13+
<None Update="Views">
14+
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
15+
</None>
16+
</ItemGroup>
17+
18+
<ItemGroup>
19+
<PackageReference Include="Belgrade.Sql.Client" Version="0.3.0" />
20+
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.0.3" />
21+
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.0.2" />
22+
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.0.3" />
23+
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.0.2" />
24+
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="1.0.2" />
25+
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.0.2" />
26+
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.0.2" />
27+
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.0.2" />
28+
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.0.2" />
29+
<PackageReference Include="System.Data.SqlClient" Version="4.1.0" />
30+
</ItemGroup>
31+
32+
<ItemGroup Condition=" '$(TargetFramework)' == 'net46' ">
33+
<Reference Include="System" />
34+
<Reference Include="Microsoft.CSharp" />
35+
</ItemGroup>
36+
37+
</Project>

samples/features/json/todo-app/dotnet-rest-api/project.json

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)