Skip to content

Commit

Permalink
Arrange Directory.Build.targets
Browse files Browse the repository at this point in the history
  • Loading branch information
thohng committed Jan 13, 2024
1 parent a844ae4 commit 70db452
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<PackageReference Update="NetLah.Extensions.Logging.Reference" Version="1.*-*" />
<PackageReference Update="NetLah.Extensions.Logging.Serilog" Version="1.*-*" />
<PackageReference Update="NetLah.Extensions.Logging.Serilog.AspNetCore" Version="1.*-*" />
<PackageReference Update="NetLah.Extensions.SpaServices.Hosting" Version="0.*-*" />
<PackageReference Update="NetLah.Extensions.SpaServices.Hosting" Version="1.*-*" />
<PackageReference Update="Testing.Dynamic.Json" Version="1.*-*" />

<!--tests-->
Expand Down
9 changes: 0 additions & 9 deletions samples/SampleSpaWebApp/Directory.Build.targets

This file was deleted.

11 changes: 8 additions & 3 deletions samples/SampleSpaWebApp/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using NetLah.Diagnostics;
using NetLah.Extensions.Logging;
using NetLah.Extensions.SpaServices.Hosting;
using Serilog;

AppLog.InitLogger("SampleWebApp");
AppLog.Logger.LogInformation("Application starting...");
Expand All @@ -15,10 +15,15 @@
var appInfo = builder.InitializeSpaApp();
logger.LogApplicationLifetimeEvent("Application initializing...", appInfo);

IAssemblyInfo assembly = new AssemblyInfo(typeof(ResponseHeadersOptions).Assembly);
logger.LogInformation("Library:{title}; Version:{version} BuildTime:{buildTime}; Framework:{framework}",

IAssemblyInfo assembly = new AssemblyInfo(typeof(WebApplicationBuilderExtensions).Assembly);
logger.LogInformation("{title}; Version:{version} BuildTime:{buildTime}; Framework:{framework}",
assembly.Title, assembly.InformationalVersion, assembly.BuildTimestampLocal, assembly.FrameworkName);

var asmSerilogAspNetCore = new AssemblyInfo(typeof(SerilogApplicationBuilderExtensions).Assembly);
logger.LogInformation("{title}; Version:{version} Framework:{framework}",
asmSerilogAspNetCore.Title, asmSerilogAspNetCore.InformationalVersion, asmSerilogAspNetCore.FrameworkName);

builder.Services.AddApplicationInsightsTelemetry();

builder.AddSpaApp();
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
<!--the helpers -->
<PackageReference Update="NetLah.Abstractions" Version="1.0.0" />
<PackageReference Update="NetLah.Extensions.CommandLineUtils" Version="0.1.0-a1.2" />
<PackageReference Update="NetLah.Extensions.Configuration" Version="0.2.2" />
<PackageReference Update="NetLah.Extensions.Configuration" Version="1.0.0-rc1" />
<PackageReference Update="NetLah.Extensions.EventAggregator" Version="0.2.1" />
<PackageReference Update="NetLah.Extensions.HttpOverrides" Version="1.0.0-rc1" />
<PackageReference Update="NetLah.Extensions.Logging.Reference" Version="1.0.0-rc1" />
<PackageReference Update="NetLah.Extensions.Logging.Serilog" Version="1.0.0-rc1" />
<PackageReference Update="NetLah.Extensions.Logging.Serilog.AspNetCore" Version="1.0.0-rc1" />
<PackageReference Update="NetLah.Extensions.SpaServices.Hosting" Version="0.2.3" />
<PackageReference Update="NetLah.Extensions.SpaServices.Hosting" Version="1.0.0-rc1" />
<PackageReference Update="Testing.Dynamic.Json" Version="1.0.0-rc3" />

<!--serilog-->
Expand Down
5 changes: 5 additions & 0 deletions src/WebApp/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project>

<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.targets', '$(MSBuildThisFileDirectory)../../'))" />

</Project>
4 changes: 2 additions & 2 deletions src/WebApp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
assembly.Title, assembly.InformationalVersion, assembly.BuildTimestampLocal, assembly.FrameworkName);

var asmSerilogAspNetCore = new AssemblyInfo(typeof(SerilogApplicationBuilderExtensions).Assembly);
logger.LogInformation("{title}; Version:{version} BuildTime:{buildTime}; Framework:{framework}",
asmSerilogAspNetCore.Title, asmSerilogAspNetCore.InformationalVersion, asmSerilogAspNetCore.BuildTimestampLocal, asmSerilogAspNetCore.FrameworkName);
logger.LogInformation("{title}; Version:{version} Framework:{framework}",
asmSerilogAspNetCore.Title, asmSerilogAspNetCore.InformationalVersion, asmSerilogAspNetCore.FrameworkName);
#endif

builder.CustomApplicationInsightsTelemetry(() => new DefaultAzureCredential());
Expand Down

0 comments on commit 70db452

Please sign in to comment.