File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3838using NLog . Extensions . Logging ;
3939using LogLevel = Microsoft . Extensions . Logging . LogLevel ;
4040
41- var builder = WebApplication . CreateBuilder ( args ) ;
41+ var builder = WebApplication . CreateBuilder ( new WebApplicationOptions
42+ {
43+ Args = args ,
44+ ContentRootPath = AppContext . BaseDirectory
45+ } ) ;
46+ builder . Host . UseWindowsService ( ) ;
4247
4348builder . WebHost . ConfigureAppConfiguration ( ( context , configBuilder ) =>
4449{
285290 validationOptions . UseAspNetCore ( ) ;
286291 } ) ;
287292
288- String contentRoot = Directory . GetCurrentDirectory ( ) ;
293+ String contentRoot = builder . Environment . ContentRootPath ;
289294String nlogConfigPath = Path . Combine ( contentRoot , "nlog.config" ) ;
290295
291296LogManager . Setup ( b =>
Original file line number Diff line number Diff line change 2222 <PackageReference Include =" Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version =" 10.0.5" />
2323 <PackageReference Include =" Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version =" 10.0.5" />
2424 <PackageReference Include =" Microsoft.AspNetCore.OpenApi" Version =" 10.0.5" />
25+ <PackageReference Include =" Microsoft.Extensions.Hosting.WindowsServices" Version =" 10.0.5" />
2526 <PackageReference Include =" Microsoft.EntityFrameworkCore.Design" Version =" 10.0.5" >
2627 <PrivateAssets >all</PrivateAssets >
2728 <IncludeAssets >runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets >
4647 <ProjectReference Include =" ..\SecurityService.Models\SecurityService.Models.csproj" />
4748 </ItemGroup >
4849 <ItemGroup >
50+ <Content Update =" appsettings.staging.json" >
51+ <CopyToOutputDirectory >Always</CopyToOutputDirectory >
52+ </Content >
4953 <Content Update =" appsettings.json" >
5054 <CopyToOutputDirectory >Always</CopyToOutputDirectory >
5155 </Content >
Original file line number Diff line number Diff line change 44 },
55 "ServiceOptions" : {
66 "SeedDefaultScopes" : false ,
7- "PublicOrigin" : " https://127.0.0.1:50001 " ,
7+ "PublicOrigin" : " https://127.0.0.1:5001 " ,
88 "IssuerUrl" : " https://127.0.0.1:5001" ,
99 "ClientId" : " serviceClient" ,
1010 "ClientSecret" : " d192cbc46d834d0da90e8a9d50ded543" ,
Original file line number Diff line number Diff line change 1+ {
2+ "ServiceOptions" : {
3+ "PublicOrigin" : " https://192.168.1.163:5001" ,
4+ "IssuerUrl" : " https://192.168.1.163:5001"
5+ },
6+ "ConnectionStrings" : {
7+ "AuthenticationDbContext" : " server=127.0.0.1;database=SecurityService;user id=sa;password=Sc0tland;Encrypt=false"
8+ }
9+ }
You can’t perform that action at this time.
0 commit comments