Files
SVSimServer/SVSim.EmulatedEntrypoint/SVSim.EmulatedEntrypoint.csproj
gamer147 9a47ac8d90 app: wire Serilog into SVSim.EmulatedEntrypoint
Registers Serilog via SVSim.Hosting.UseSvSimSerilog("svsim-api") right
after CreateBuilder and wraps Main in try/catch/finally so a fatal
startup exception logs before CloseAndFlush.

Also updates the SVSim.Hosting extension to gate the file sink on entry
assembly rather than the ASP.NET environment name. WebApplicationFactory
sets the environment via a hook that resolves after both CreateBuilder
and the UseSerilog callback see their environment view, so
IsEnvironment("Testing") is unreliable in tests. The entry assembly
under `dotnet test` is always "testhost", which is a reliable signal.

appsettings.json grows a Serilog section mirroring the existing
Logging:LogLevel overrides; the Logging block itself is left in place
per the spec's follow-up cleanup note.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-07-04 02:07:41 -04:00

71 lines
2.9 KiB
XML

<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<InvariantGlobalization>true</InvariantGlobalization>
<!-- See SVSim.BattleNode.csproj — same NU1903 audit suppression so MSBuildWorkspace
loads this project cleanly during ClosureAnalyzer runs. -->
<NoWarn>$(NoWarn);NU1903</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Facepunch.Steamworks" Version="2.3.3" />
<PackageReference Include="MessagePack" Version="2.5.172" />
<PackageReference Include="MessagePackAnalyzer" Version="2.5.172">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="8.0.4" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
</ItemGroup>
<ItemGroup>
<InternalsVisibleTo Include="SVSim.UnitTests" />
</ItemGroup>
<ItemGroup>
<!-- The host exe runs EngineGlobalInit, which reads Data/cards.json from its OWN output dir.
CopyToOutput content does NOT flow across a ProjectReference, so the host needs its own copy. -->
<None Include="..\SVSim.Bootstrap\Data\cards.json" Link="Data\cards.json" CopyToOutputDirectory="PreserveNewest" />
<None Include="Data\card_master_2026-06-03.txt" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SVSim.Database\SVSim.Database.csproj" />
<ProjectReference Include="..\SVSim.BattleNode\SVSim.BattleNode.csproj" />
<ProjectReference Include="..\SVSim.Hosting\SVSim.Hosting.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="lib\libsteam_api.so">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</None>
<None Update="lib\libsteam_api.so.meta">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</None>
<None Update="lib\steam_api.dll">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</None>
<None Update="lib\steam_api.lib">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</None>
<None Update="lib\steam_api64.dll">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</None>
<None Update="lib\steam_api64.lib">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</None>
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="COPY &quot;$(ProjectDir)\lib\*&quot; &quot;$(TargetDir)&quot;" />
</Target>
</Project>