Skip to content

Commit 9db9305

Browse files
ANcpLuaclaude
andcommitted
fix: bypass dotnet run project resolution in Web SDK tests
- Change Web_ServiceDefaultsIsRegisteredAutomatically tests to build first, then run the compiled DLL directly via `dotnet <path>.dll` - This bypasses `dotnet run`'s problematic project resolution with custom SDKs which fails with "not a valid project file" in test environment - Also includes various test improvements and editorconfig precedence fixes Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent cc6a74e commit 9db9305

26 files changed

+342
-71
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020
<BaseOutputPath>$(ArtifactsPath)bin/$(MSBuildProjectName)/</BaseOutputPath>
2121
<BaseIntermediateOutputPath>$(ArtifactsPath)obj/$(MSBuildProjectName)/</BaseIntermediateOutputPath>
2222
</PropertyGroup>
23-
</Project>
23+
</Project>

Directory.Packages.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
<PropertyGroup>
1616
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
1717
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
18-
<NoWarn>$(NoWarn);NU1507</NoWarn>
1918
</PropertyGroup>
2019

2120
<!-- Roslyn - Workspaces pulls in Common + CSharp transitively -->

NuGet.config

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,11 @@
44
<clear />
55
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
66
</packageSources>
7+
8+
<!-- Package Source Mapping: ensures all packages come from nuget.org (fixes NU1507) -->
9+
<packageSourceMapping>
10+
<packageSource key="nuget.org">
11+
<package pattern="*" />
12+
</packageSource>
13+
</packageSourceMapping>
714
</configuration>

build.ps1

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,21 @@ $VersionPropsContent = @"
5050
ROSLYN.UTILITIES (Runtime package)
5151
═══════════════════════════════════════════════════════════════════════ -->
5252
<PropertyGroup Label="Roslyn.Utilities">
53-
<ANcpLuaRoslynUtilitiesVersion>1.14.0</ANcpLuaRoslynUtilitiesVersion>
53+
<ANcpLuaRoslynUtilitiesVersion>1.16.0</ANcpLuaRoslynUtilitiesVersion>
5454
</PropertyGroup>
5555
5656
<!-- ═══════════════════════════════════════════════════════════════════════
5757
ROSLYN.UTILITIES.SOURCES (Source-only package for generators)
5858
═══════════════════════════════════════════════════════════════════════ -->
5959
<PropertyGroup Label="Roslyn.Utilities.Sources">
60-
<ANcpLuaRoslynUtilitiesSourcesVersion>1.14.0</ANcpLuaRoslynUtilitiesSourcesVersion>
60+
<ANcpLuaRoslynUtilitiesSourcesVersion>1.16.0</ANcpLuaRoslynUtilitiesSourcesVersion>
6161
</PropertyGroup>
6262
6363
<!-- ═══════════════════════════════════════════════════════════════════════
6464
ROSLYN.UTILITIES.TESTING (Analyzer/CodeFix/Generator test infrastructure)
6565
═══════════════════════════════════════════════════════════════════════ -->
6666
<PropertyGroup Label="Roslyn.Utilities.Testing">
67-
<ANcpLuaRoslynUtilitiesTestingVersion>1.14.0</ANcpLuaRoslynUtilitiesTestingVersion>
67+
<ANcpLuaRoslynUtilitiesTestingVersion>1.16.0</ANcpLuaRoslynUtilitiesTestingVersion>
6868
</PropertyGroup>
6969
7070
<!-- ═══════════════════════════════════════════════════════════════════════
@@ -88,12 +88,12 @@ $VersionPropsContent = @"
8888
Used by: SDK, Roslyn.Utilities
8989
═══════════════════════════════════════════════════════════════════════ -->
9090
<PropertyGroup Label="Meziantou">
91-
<MeziantouFrameworkVersion>5.0.7</MeziantouFrameworkVersion>
92-
<MeziantouFullPathVersion>1.1.12</MeziantouFullPathVersion>
93-
<MeziantouTemporaryDirectoryVersion>1.0.30</MeziantouTemporaryDirectoryVersion>
94-
<MeziantouThreadingVersion>2.0.3</MeziantouThreadingVersion>
95-
<MeziantouDependencyScanningVersion>2.0.5</MeziantouDependencyScanningVersion>
96-
<MeziantouAnalyzerVersion>2.0.188</MeziantouAnalyzerVersion>
91+
<MeziantouFrameworkVersion>5.0.11</MeziantouFrameworkVersion>
92+
<MeziantouFullPathVersion>1.1.13</MeziantouFullPathVersion>
93+
<MeziantouTemporaryDirectoryVersion>1.0.31</MeziantouTemporaryDirectoryVersion>
94+
<MeziantouThreadingVersion>2.0.4</MeziantouThreadingVersion>
95+
<MeziantouDependencyScanningVersion>2.0.6</MeziantouDependencyScanningVersion>
96+
<MeziantouAnalyzerVersion>2.0.284</MeziantouAnalyzerVersion>
9797
<MeziantouParallelTestFrameworkVersion>1.0.6</MeziantouParallelTestFrameworkVersion>
9898
</PropertyGroup>
9999
@@ -125,7 +125,7 @@ $VersionPropsContent = @"
125125
ANALYZERS (SDK-injected)
126126
═══════════════════════════════════════════════════════════════════════ -->
127127
<PropertyGroup Label="Analyzers">
128-
<ANcpLuaAnalyzersVersion>1.6.16</ANcpLuaAnalyzersVersion>
128+
<ANcpLuaAnalyzersVersion>1.9.0</ANcpLuaAnalyzersVersion>
129129
<SbomTargetsVersion>4.1.5</SbomTargetsVersion>
130130
<BannedApiAnalyzersVersion>3.3.4</BannedApiAnalyzersVersion>
131131
<JonSkeetAnalyzersVersion>1.0.0-beta.6</JonSkeetAnalyzersVersion>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
namespace ANcpSdk.AspNetCore.ServiceDefaults;
22

3+
/// <summary>
4+
/// Configuration options for Anti-Forgery protection.
5+
/// </summary>
36
public sealed class ANcpSdkAntiForgeryConfiguration
47
{
8+
/// <summary>
9+
/// Gets or sets a value indicating whether Anti-Forgery services and middleware are enabled.
10+
/// <value>The default value is <see langword="true"/>.</value>
11+
/// </summary>
512
public bool Enabled { get; set; } = true;
613
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
11
namespace ANcpSdk.AspNetCore.ServiceDefaults;
22

3+
/// <summary>
4+
/// Configuration options for the developer logging endpoint.
5+
/// </summary>
36
public sealed class ANcpSdkDevLogsConfiguration
47
{
8+
/// <summary>
9+
/// Gets or sets a value indicating whether the developer logging endpoint is enabled.
10+
/// <value>The default value is <see langword="true"/>.</value>
11+
/// </summary>
512
public bool Enabled { get; set; } = true;
13+
14+
/// <summary>
15+
/// Gets or sets the route pattern for the logging endpoint.
16+
/// <value>The default value is <c>"/api/dev-logs"</c>.</value>
17+
/// </summary>
618
public string RoutePattern { get; set; } = "/api/dev-logs";
19+
20+
/// <summary>
21+
/// Gets or sets a value indicating whether the logging endpoint is enabled in production environments.
22+
/// <value>The default value is <see langword="false"/>.</value>
23+
/// </summary>
724
public bool EnableInProduction { get; set; }
825
}

eng/ANcpSdk.AspNetCore.ServiceDefaults/ANcpSdkForwardedHeadersConfiguration.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,15 @@
22

33
namespace ANcpSdk.AspNetCore.ServiceDefaults;
44

5+
/// <summary>
6+
/// Configuration options for forwarded headers middleware.
7+
/// </summary>
58
public sealed class ANcpSdkForwardedHeadersConfiguration
69
{
10+
/// <summary>
11+
/// Gets or sets the forwarded headers to process.
12+
/// <value>The default is <see cref="ForwardedHeaders.XForwardedFor"/> | <see cref="ForwardedHeaders.XForwardedProto"/> | <see cref="ForwardedHeaders.XForwardedHost"/>.</value>
13+
/// </summary>
714
public ForwardedHeaders ForwardedHeaders { get; set; } =
815
ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto | ForwardedHeaders.XForwardedHost;
916
}

eng/ANcpSdk.AspNetCore.ServiceDefaults/ANcpSdkHttpsConfiguration.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@ namespace ANcpSdk.AspNetCore.ServiceDefaults;
22

33
public sealed class ANcpSdkHttpsConfiguration
44
{
5+
/// <summary>
6+
/// Gets or sets a value indicating whether HTTPS redirection is enabled.
7+
/// <value>The default value is <see langword="true"/>.</value>
8+
/// </summary>
59
public bool Enabled { get; set; } = true;
10+
11+
/// <summary>
12+
/// Gets or sets a value indicating whether HTTP Strict Transport Security (HSTS) is enabled.
13+
/// <para>
14+
/// HSTS is only enabled in non-development environments.
15+
/// </para>
16+
/// <value>The default value is <see langword="true"/>.</value>
17+
/// </summary>
618
public bool HstsEnabled { get; set; } = true;
719
}

eng/ANcpSdk.AspNetCore.ServiceDefaults/ANcpSdkOpenApiConfiguration.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,25 @@
33

44
namespace ANcpSdk.AspNetCore.ServiceDefaults;
55

6+
/// <summary>
7+
/// Configuration options for OpenAPI document generation and serving.
8+
/// </summary>
69
public sealed class ANcpSdkOpenApiConfiguration
710
{
11+
/// <summary>
12+
/// Gets or sets a value indicating whether OpenAPI support is enabled.
13+
/// <value>The default value is <see langword="true"/>.</value>
14+
/// </summary>
815
public bool Enabled { get; set; } = true;
16+
17+
/// <summary>
18+
/// Gets or sets a delegate to configure <see cref="OpenApiOptions"/>.
19+
/// </summary>
920
public Action<OpenApiOptions>? ConfigureOpenApi { get; set; }
1021

22+
/// <summary>
23+
/// Gets or sets the route pattern for the OpenAPI JSON document.
24+
/// <value>The default value is <c>"/openapi/{documentName}.json"</c>.</value>
25+
/// </summary>
1126
[StringSyntax("Route")] public string RoutePattern { get; set; } = "/openapi/{documentName}.json";
1227
}

eng/ANcpSdk.AspNetCore.ServiceDefaults/ANcpSdkOpenTelemetryConfiguration.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,23 @@
44

55
namespace ANcpSdk.AspNetCore.ServiceDefaults;
66

7+
/// <summary>
8+
/// Configuration options for OpenTelemetry instrumentation.
9+
/// </summary>
710
public sealed class ANcpSdkOpenTelemetryConfiguration
811
{
12+
/// <summary>
13+
/// Gets or sets a delegate to configure OpenTelemetry logging.
14+
/// </summary>
915
public Action<OpenTelemetryLoggerOptions>? ConfigureLogging { get; set; }
16+
17+
/// <summary>
18+
/// Gets or sets a delegate to configure OpenTelemetry metrics.
19+
/// </summary>
1020
public Action<MeterProviderBuilder>? ConfigureMetrics { get; set; }
21+
22+
/// <summary>
23+
/// Gets or sets a delegate to configure OpenTelemetry tracing.
24+
/// </summary>
1125
public Action<TracerProviderBuilder>? ConfigureTracing { get; set; }
1226
}

0 commit comments

Comments
 (0)