Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,24 @@ root = true
dotnet_sort_system_directives_first = false

# XML documentation
dotnet_diagnostic.CS1574.severity = warning
dotnet_diagnostic.CS1591.severity = warning

# ASP.NET
dotnet_diagnostic.ASP0015.severity = warning

# Code Analysis (CA)
dotnet_diagnostic.CA1050.severity = warning
dotnet_diagnostic.CA1416.severity = warning
dotnet_diagnostic.CA1401.severity = warning
dotnet_diagnostic.CA1806.severity = warning
dotnet_diagnostic.CA1816.severity = warning
dotnet_diagnostic.CA1822.severity = warning
dotnet_diagnostic.CA1826.severity = warning
dotnet_diagnostic.CA1834.severity = warning
dotnet_diagnostic.CA1847.severity = warning
dotnet_diagnostic.CA1859.severity = warning
dotnet_diagnostic.CA1861.severity = warning
dotnet_diagnostic.CA1869.severity = warning
dotnet_diagnostic.CA2016.severity = warning

Expand All @@ -30,11 +34,14 @@ dotnet_diagnostic.IDE0059.severity = warning
dotnet_diagnostic.IDE0060.severity = warning
dotnet_diagnostic.IDE0074.severity = warning
dotnet_diagnostic.IDE0180.severity = warning
dotnet_diagnostic.IDE0230.severity = warning
dotnet_diagnostic.IDE0270.severity = warning
dotnet_diagnostic.IDE0290.severity = warning
dotnet_diagnostic.IDE0300.severity = warning
dotnet_diagnostic.IDE0301.severity = warning
dotnet_diagnostic.IDE0305.severity = warning
dotnet_diagnostic.IDE0330.severity = warning
dotnet_diagnostic.IDE1006.severity = warning

# System library
dotnet_diagnostic.SYSLIB1054.severity = warning
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
*.bats text eol=lf
*.bash text eol=lf
scripts/*.cs text eol=lf
scripts/**/*.cs text eol=lf
45 changes: 41 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,51 @@ jobs:
run: dotnet build --no-restore

- name: Test
run: dotnet test --no-build --verbosity normal --collect:"XPlat Code Coverage"
timeout-minutes: 30
shell: bash
run: |
set -euo pipefail

- name: Upload coverage
for project in \
tests/Dotsider.Tests/Dotsider.Tests.csproj \
tests/Dotsider.Mcp.Tests/Dotsider.Mcp.Tests.csproj \
tests/Dotsider.Website.Tests/Dotsider.Website.Tests.csproj
do
project_name="$(basename "$(dirname "$project")")"
result_dir="TestResults/${{ matrix.os }}/${project_name}"
mkdir -p "$result_dir"
export DOTSIDER_R2R_DIAGNOSTICS=1
export DOTSIDER_R2R_DIAGNOSTICS_PATH="$result_dir/r2r-diagnostics.log"
: > "$DOTSIDER_R2R_DIAGNOSTICS_PATH"
set +e
dotnet test "$project" \
--no-build \
--report-trx \
--results-directory "$result_dir" \
--coverage \
--coverage-output-format cobertura \
--diagnostic \
--diagnostic-verbosity Trace \
--diagnostic-output-directory "$result_dir" \
--diagnostic-file-prefix "$project_name" \
2>&1 | tee "$result_dir/dotnet-test.log"
status=${PIPESTATUS[0]}
set -e
if [ "$status" -ne 0 ]; then
exit "$status"
fi
done

- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v7
with:
name: coverage-${{ matrix.os }}
path: '**/TestResults/**/coverage.cobertura.xml'
name: test-results-${{ matrix.os }}
path: |
TestResults/**/*.trx
TestResults/**/*.cobertura.xml
TestResults/**/*.diag
TestResults/**/*.log

deploy-tests:
runs-on: ubuntu-latest
Expand Down
7 changes: 7 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project>
<PropertyGroup>
<AnalysisLevel>latest</AnalysisLevel>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
</Project>
25 changes: 25 additions & 0 deletions Dotsider.slnx
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
<Solution>
<Folder Name="/Solution Items/">
<File Path=".editorconfig" />
<File Path=".gitattributes" />
<File Path=".gitignore" />
<File Path="CONTRIBUTING.md" />
<File Path="Directory.Build.props" />
<File Path="global.json" />
<File Path="LICENSE" />
<File Path="README.md" />
</Folder>

<Folder Name="/src/">
<Project Path="src/Dotsider.Core/Dotsider.Core.csproj" />
<Project Path="src/Dotsider/Dotsider.csproj" />
Expand Down Expand Up @@ -40,12 +51,26 @@
<Project Path="samples/NetFxBindingRedirects.Clr2.PrivatePathLib/NetFxBindingRedirects.Clr2.PrivatePathLib.csproj" />
<Project Path="samples/NetFxBindingRedirects.Clr2.CodeBaseLib/NetFxBindingRedirects.Clr2.CodeBaseLib.csproj" />
<Project Path="samples/NetFxBindingRedirects.Clr2.CulturedLib/NetFxBindingRedirects.Clr2.CulturedLib.csproj" />
<File Path="samples/NativeAotArtifactsConsole/Directory.Build.props" />
</Folder>

<Folder Name="/tests/">
<Project Path="tests/Dotsider.Tests/Dotsider.Tests.csproj" />
<File Path="tests/Shared/MSTestSettings.cs" />
<File Path="tests/Shared/TestAssert.cs" />
<File Path="tests/Shared/TestSkip.cs" />
<File Path="tests/Shared/TestSocketIds.cs" />
<Project Path="tests/Dotsider.Mcp.Tests/Dotsider.Mcp.Tests.csproj" />
<Project Path="tests/Dotsider.Website.Tests/Dotsider.Website.Tests.csproj" />
<File Path="tests/Directory.Build.props" />
</Folder>

<Folder Name="/scripts/">
<File Path="scripts/Capture-DisasmOracle.cs" />
<File Path="scripts/Directory.Build.props" />
<File Path="scripts/README.md" />
<File Path="scripts/Run-Tests.cs" />
<File Path="scripts/ScriptSupport.cs" />
</Folder>

<Folder Name="/benchmarks/">
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/Dotsider.Benchmarks/Dotsider.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.15.*" />
<PackageReference Include="ModelContextProtocol" Version="1.1.0" />
<PackageReference Include="ModelContextProtocol" Version="1.4.1" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 8 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"test": {
"runner": "Microsoft.Testing.Platform"
},
"msbuild-sdks": {
"MSTest.Sdk": "4.3.0"
}
}
2 changes: 1 addition & 1 deletion samples/AppLocalRollForward/AppLocalRollForward.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
build of the same package, so the deployed app-local DLL has the same simple
name and PKT but a strictly greater assembly version. That divergence is the
scenario the resolver fix exists to handle. -->
<PackageReference Include="Microsoft.Diagnostics.Tracing.TraceEvent" Version="3.2.2" />
<PackageReference Include="Microsoft.Diagnostics.Tracing.TraceEvent" Version="3.2.4" />
<PackageReference Include="Microsoft.Diagnostics.NETCore.Client" Version="0.2.661903" />
</ItemGroup>
</Project>
4 changes: 3 additions & 1 deletion samples/NativeAotArtifactsConsole/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<!-- FROZEN TEST FIXTURE — do not modify without updating Dotsider.Tests -->
<!-- UseArtifactsOutput must be set in Directory.Build.props (the SDK rejects it in the
project file). Scoped to this sample: the repo has no root Directory.Build.props. -->
project file). Scoped to this sample. -->
<Project>
<Import Project="..\..\Directory.Build.props" />

<PropertyGroup>
<UseArtifactsOutput>true</UseArtifactsOutput>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion samples/NetFxBindingRedirects.Clr2/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ private static string ToJson(IDictionary<string, Entry> map)
sb.Append(" \"fullName\": ").Append(JsonString(kv.Value.FullName)).Append(",\n");
sb.Append(" \"location\": ").Append(JsonString(kv.Value.Location)).Append(",\n");
sb.Append(" \"loaded\": ").Append(kv.Value.Loaded ? "true" : "false").Append(",\n");
sb.Append(" \"error\": ").Append(JsonString(kv.Value.Error)).Append("\n");
sb.Append(" \"error\": ").Append(JsonString(kv.Value.Error)).Append('\n');
sb.Append(" }");
}
sb.Append("\n}\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="all" />
<!-- Compiled against Newtonsoft.Json 13.0.3 — NewDep's metadata records this version. -->
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<!-- Keep NewDep on a Newtonsoft.Json 13.x package; its assembly reference records 13.0.0.0. -->
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="all" />
<!-- Compiled against Newtonsoft.Json 12.0.1 — OldDep's metadata records this version. -->
<!-- Keep OldDep on a Newtonsoft.Json 12.x package; its assembly reference records 12.0.0.0. -->
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
</ItemGroup>
</Project>
29 changes: 10 additions & 19 deletions samples/NetFxBindingRedirects/NetFxBindingRedirects.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- FROZEN TEST FIXTURE — do not modify without updating Dotsider.Tests -->
<!--
Root EXE for the NetFxBinder test suite. Targets net48 and exercises every code path:
- app-local NuGet binding redirect (Newtonsoft.Json 12 → 13)
- app-local NuGet binding redirect (Newtonsoft.Json assembly identity 12.0.0.0 -> 13.0.0.0)
- GAC-only references (System.Drawing, System.Windows.Forms)
- <probing privatePath="lib"/> (PrivatePathLib copied to lib/)
- <codeBase href="external/CodeBaseLib.dll"/> (CodeBaseLib copied to external/)
Expand Down Expand Up @@ -30,7 +30,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="all" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<!-- Keep the root EXE on a Newtonsoft.Json 13.x package so the redirected target is app-local. -->
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
</ItemGroup>
Expand All @@ -44,27 +45,17 @@
</ItemGroup>

<Target Name="CopyPrivatePathAndCodeBaseLibs" AfterTargets="Build">
<MSBuild Projects="..\NetFxBindingRedirects.PrivatePathLib\NetFxBindingRedirects.PrivatePathLib.csproj"
Targets="Build"
Properties="Configuration=$(Configuration)" />
<MSBuild Projects="..\NetFxBindingRedirects.CodeBaseLib\NetFxBindingRedirects.CodeBaseLib.csproj"
Targets="Build"
Properties="Configuration=$(Configuration)" />
<MSBuild Projects="..\NetFxBindingRedirects.CulturedLib\NetFxBindingRedirects.CulturedLib.csproj"
Targets="Build"
Properties="Configuration=$(Configuration)" />
<MSBuild Projects="..\NetFxBindingRedirects.PrivatePathLib\NetFxBindingRedirects.PrivatePathLib.csproj" Targets="Build" Properties="Configuration=$(Configuration)" />
<MSBuild Projects="..\NetFxBindingRedirects.CodeBaseLib\NetFxBindingRedirects.CodeBaseLib.csproj" Targets="Build" Properties="Configuration=$(Configuration)" />
<MSBuild Projects="..\NetFxBindingRedirects.CulturedLib\NetFxBindingRedirects.CulturedLib.csproj" Targets="Build" Properties="Configuration=$(Configuration)" />

<MakeDir Directories="$(OutDir)lib" />
<MakeDir Directories="$(OutDir)external" />
<MakeDir Directories="$(OutDir)fr" />

<Copy SourceFiles="..\NetFxBindingRedirects.PrivatePathLib\bin\$(Configuration)\net48\NetFxBindingRedirects.PrivatePathLib.dll"
DestinationFolder="$(OutDir)lib" />
<Copy SourceFiles="..\NetFxBindingRedirects.CodeBaseLib\bin\$(Configuration)\net48\NetFxBindingRedirects.CodeBaseLib.dll"
DestinationFolder="$(OutDir)external" />
<Copy SourceFiles="..\NetFxBindingRedirects.CulturedLib\bin\$(Configuration)\net48\CulturedLib.dll"
DestinationFolder="$(OutDir)" />
<Copy SourceFiles="..\NetFxBindingRedirects.CulturedLib\bin\$(Configuration)\net48\fr\CulturedLib.resources.dll"
DestinationFolder="$(OutDir)fr" />
<Copy SourceFiles="..\NetFxBindingRedirects.PrivatePathLib\bin\$(Configuration)\net48\NetFxBindingRedirects.PrivatePathLib.dll" DestinationFolder="$(OutDir)lib" />
<Copy SourceFiles="..\NetFxBindingRedirects.CodeBaseLib\bin\$(Configuration)\net48\NetFxBindingRedirects.CodeBaseLib.dll" DestinationFolder="$(OutDir)external" />
<Copy SourceFiles="..\NetFxBindingRedirects.CulturedLib\bin\$(Configuration)\net48\CulturedLib.dll" DestinationFolder="$(OutDir)" />
<Copy SourceFiles="..\NetFxBindingRedirects.CulturedLib\bin\$(Configuration)\net48\fr\CulturedLib.resources.dll" DestinationFolder="$(OutDir)fr" />
</Target>
</Project>
2 changes: 1 addition & 1 deletion samples/NetFxBindingRedirects/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ private static string ToJson(IDictionary<string, Entry> map)
sb.Append(" \"fullName\": ").Append(JsonString(kv.Value.FullName)).Append(",\n");
sb.Append(" \"location\": ").Append(JsonString(kv.Value.Location)).Append(",\n");
sb.Append(" \"loaded\": ").Append(kv.Value.Loaded ? "true" : "false").Append(",\n");
sb.Append(" \"error\": ").Append(JsonString(kv.Value.Error)).Append("\n");
sb.Append(" \"error\": ").Append(JsonString(kv.Value.Error)).Append('\n');
sb.Append(" }");
}
sb.Append("\n}\n");
Expand Down
26 changes: 14 additions & 12 deletions scripts/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AnalysisLevel>latest</AnalysisLevel>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Deterministic>true</Deterministic>
<IsPackable>false</IsPackable>
<PackAsTool>false</PackAsTool>
</PropertyGroup>
<Import Project="..\Directory.Build.props" />

<PropertyGroup>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AnalysisLevel>latest</AnalysisLevel>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Deterministic>true</Deterministic>
<IsPackable>false</IsPackable>
<PackAsTool>false</PackAsTool>
</PropertyGroup>
</Project>
Loading