add clear log provide

This commit is contained in:
2026-08-23 18:15:40 +10:00
parent 4eafa2fa8d
commit ba4976fce4
6 changed files with 76 additions and 13 deletions
+20 -1
View File
@@ -2,6 +2,7 @@
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{ {
"name": "C#: FamilyTreeAPI", "name": "C#: FamilyTreeAPI",
"type": "coreclr", "type": "coreclr",
@@ -27,7 +28,25 @@
"/Views": "${workspaceFolder}/Views" "/Views": "${workspaceFolder}/Views"
}, },
} },
{
"name": ".NET Core Launch (web) - Release",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "publish",
"program": "${workspaceFolder}\\FamilyTreeAPI\\bin\\Release\\net10.0\\FamilyTreeAPI.dll",
"serverReadyAction": {
"action": "openExternally",
"pattern": "listening on:\\s+(https?://\\S+)",
"uriFormat": "%s/swagger/index.html"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Production",
"ASPNETCORE_URLS": "https://localhost:5019"
},
"cwd": "${workspaceFolder}"
}
+13 -1
View File
@@ -7,13 +7,25 @@
"type": "shell", "type": "shell",
"args": [ "args": [
"build", "build",
"${workspaceFolder}/FamilyTreeAPI/FamilyTreeAPI.csproj", "${workspaceFolder}/FamilyTreeAPI/FamilyTreeAPI.csproj",
"/property:GenerateFullPaths=true", "/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary" "/consoleloggerparameters:NoSummary"
], ],
"problemMatcher": "$msCompile" "problemMatcher": "$msCompile"
}, },
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/FamilyTreeAPI/FamilyTreeAPI.csproj",
"-c",
"Release"
],
"problemMatcher": "$msCompile"
},
] ]
} }
@@ -37,7 +37,7 @@ public class UsersController : ControllerBase
public async Task<IActionResult> LoginApiAD([FromBody] AuthenticateRequest model) public async Task<IActionResult> LoginApiAD([FromBody] AuthenticateRequest model)
{ {
string remoteIpAddress = HttpContext.Connection.RemoteIpAddress?.ToString(); string remoteIpAddress = HttpContext.Connection.RemoteIpAddress?.ToString();
var rval = await _repoUser.LoginApiAD(userdetail, remoteIpAddress); var rval = await _userService.LoginApiAD(model, remoteIpAddress);
if (rval.Data != null && rval.Data.Token != null) if (rval.Data != null && rval.Data.Token != null)
{ {
// Configure cookie options // Configure cookie options
+9 -8
View File
@@ -10,23 +10,24 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="HotChocolate.AspNetCore" Version="16.0.0" /> <PackageReference Include="HotChocolate.AspNetCore" Version="16.6.1" />
<PackageReference Include="HotChocolate.Data.EntityFramework" Version="16.0.0" /> <PackageReference Include="HotChocolate.Data.EntityFramework" Version="16.6.1" />
<PackageReference Include="HotChocolate.Pagination.EntityFramework" Version="14.3.1" /> <PackageReference Include="HotChocolate.Pagination.EntityFramework" Version="14.3.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.7" /> <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.7" /> <PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.7"> <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.11">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.7"> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.11">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.23.0" /> <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.23.0" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.1" /> <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.3" />
<PackageReference Include="SpreadsheetLight" Version="3.5.0" /> <PackageReference Include="SpreadsheetLight" Version="3.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="10.1.7" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="10.2.3" />
<PackageReference Include="System.Drawing.Common" Version="10.0.11" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
+32
View File
@@ -13,6 +13,9 @@ using FamilyTreeAPI.Repository;
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);
builder.Logging.ClearProviders();
builder.Logging.AddConsole();
builder.Logging.AddDebug();
// Explicitly register the base paths for Linux container execution // Explicitly register the base paths for Linux container execution
builder.Configuration builder.Configuration
.SetBasePath(AppContext.BaseDirectory) // <-- Pulls from wherever the binary sits .SetBasePath(AppContext.BaseDirectory) // <-- Pulls from wherever the binary sits
@@ -220,4 +223,33 @@ query {
} }
} }
} }
dotnet --list-sdks
In the VS Code Explorer, click and open your <ProjectName>.csproj file.
Locate the <TargetFramework> tag inside the <PropertyGroup> block.
Change the value to your desired version (e.g., change net11.0 or net9.0 to net10.0
now run to see out of date
dotnet list package --outdated
dotnet tool uninstall --global dotnet-outdated
dotnet tool install --global dotnet-outdated-tool
//update the outdate
dotnet outdated -u
update the package
dotnet add package <Package_Name>
Open the .vscode folder in your workspace and select launch.json.
Look for lines containing your old framework directory string (e.g., /bin/Debug/net8.0/).
Update those paths to reflect your new version (e.g., /bin/Debug/net9.0/).
clear and rebuild
dotnet clean
dotnet restore
dotnet build
*/ */
-1
View File
@@ -66,7 +66,6 @@ public class Seed
var conn = _context.Database.GetDbConnection(); var conn = _context.Database.GetDbConnection();
try try
{ {
conn.Open(); conn.Open();
var command = conn.CreateCommand(); var command = conn.CreateCommand();
command.CommandText = sptext; command.CommandText = sptext;