Skip to content

Upgrade RestSharp fork from .NET 2.0/3.5 to .NET Framework 4.8#14

Open
devin-ai-integration[bot] wants to merge 6 commits into
masterfrom
devin/1780930243-net48-upgrade
Open

Upgrade RestSharp fork from .NET 2.0/3.5 to .NET Framework 4.8#14
devin-ai-integration[bot] wants to merge 6 commits into
masterfrom
devin/1780930243-net48-upgrade

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jun 8, 2026

Copy link
Copy Markdown

Summary

Modernizes this legacy RestSharp fork from a multi-targeted .NET 2.0/3.5 (+ Silverlight/Windows Phone/Mono/MonoTouch) codebase down to a single .NET Framework 4.8 target, and refreshes its NuGet dependencies. Executed as six ordered phases, with the build verified to compile after each.

The fork only existed to backport LINQ and System.Xml.Linq to .NET 2.0; on 4.8 these are built in, so all the shims and dead-platform code are removed.

Phase-by-phase

  1. Remove dead platform projects — deleted RestSharp.Silverlight/, RestSharp.WindowsPhone/, RestSharp.WindowsPhone.Mango/, RestSharp.MonoDroid/, RestSharp.MonoTouch/; deleted RestSharp.Mono.sln and RestSharp.Net2.sln; pruned their entries from RestSharp.sln.
  2. Retire RestSharp.Net2 — deleted the whole project (LinqBridge-1.2.cs, the 28-file Mono System.Xml.Linq/ reimplementation, csproj, AssemblyInfo) and its RestSharp.sln entry.
  3. Retarget to 4.8TargetFrameworkVersionv4.8 for RestSharp, RestSharp.Tests, RestSharp.IntegrationTests; removed Client Profile, RequiredTargetFramework=3.5 hints, .NET 3.5 BootstrapperPackage items, and a duplicate Microsoft.CSharp.targets import.
  4. Resolve conditional compilation — removed dead #if SILVERLIGHT|WINDOWS_PHONE|MONODROID|MONOTOUCH|Net2|NET_2_0 blocks and unwrapped always-true #if FRAMEWORK blocks across the source; dropped the now-redundant FRAMEWORK define.
  5. Update dependencies — Newtonsoft.Json 4.x13.0.3 (net45) and xunit 1.9.0.15662.4.2. Test code was already API-compatible (only Assert.Equal/NotNull/Null/Empty/NotEmpty/True/False + [Fact]).
  6. Docs & metadata — rewrote README.markdown for 4.8, bumped assembly version 102.7.0.0103.0.0.0, updated restsharp.nuspec (version, Newtonsoft.Json 13.0.3 dependency, release notes), and deleted the obsolete package.cmd (only built dead platforms and referenced a missing tools/ dir).

Notable details for reviewers

  • xunit 2.x parallelization: xunit 2 parallelizes test collections by default, which made the integration tests collide on the shared localhost:8080 HttpListener. Added [assembly: CollectionBehavior(DisableTestParallelization = true)] to RestSharp.IntegrationTests to restore the serial behavior xunit 1.x had.
  • Committed packages: this repo vendors packages/ (no restore step in the build), so the new package folders are committed and the stale Newtonsoft.Json.4.0.8/4.5.1, xunit.1.x, and xunit.extensions folders are removed. packages/repositories.config was pruned to the three remaining projects.

Testing

Built on Linux via dotnet msbuild against Mono's .NET 4.8 reference assemblies (/usr/lib/mono/4.8-api):

dotnet msbuild RestSharp.sln /p:Configuration=Release \
  /p:FrameworkPathOverride=/usr/lib/mono/4.8-api /v:minimal /nologo
  • Solution build: succeeds (exit 0; only CS1591 missing-XML-doc warnings).
  • Unit tests (RestSharp.Tests): 83/83 pass.
  • Integration tests (RestSharp.IntegrationTests): 11 pass, 1 skipped (needs real OAuth consumer key/secret), 1 fails only because the test hardcodes a Windows path separator (Environment.CurrentDirectory + "\\Assets\\Koala.jpg") that doesn't resolve on Linux — both are environmental and would pass on Windows; neither is a regression from this upgrade. Test logic was intentionally left unchanged.

Link to Devin session: https://app.devin.ai/sessions/2094321fcfeb47d38f3db44450b60040
Requested by: @travismyers-png


Devin Review

Status Commit
⚪ Not started

Run Devin Review

💡 Connect your GitHub account to enable automatic code reviews.

Open in Devin Review (Staging)

devin-ai-integration Bot and others added 6 commits June 8, 2026 14:51
…ture)

Delete Silverlight, WindowsPhone, WindowsPhone.Mango, MonoDroid, and MonoTouch
projects targeting dead platforms. Remove RestSharp.Mono.sln and RestSharp.Net2.sln,
consolidating into RestSharp.sln with their project + config entries removed.

Co-Authored-By: Travis Myers <travis.myers@cognition.ai>
… (feature)

Delete RestSharp.Net2 (LinqBridge + Mono System.Xml.Linq reimplementation) which
only existed for .NET 2.0; LINQ and System.Xml.Linq are built into .NET 3.5+.
Remove its project and config entries from RestSharp.sln.

Co-Authored-By: Travis Myers <travis.myers@cognition.ai>
Retarget RestSharp, RestSharp.Tests, and RestSharp.IntegrationTests to v4.8.
Drop the 3.5 Client Profile, remove RequiredTargetFramework=3.5 hints, .NET 3.5
BootstrapperPackage items, and the duplicate Microsoft.CSharp.targets import.

Co-Authored-By: Travis Myers <travis.myers@cognition.ai>
Resolve dead-platform #if directives now that only the FRAMEWORK target remains:
delete SILVERLIGHT/WINDOWS_PHONE/MONODROID/MONOTOUCH/Net2/NET_2_0 blocks and
unwrap always-true FRAMEWORK blocks across 37 files. Drop redundant FRAMEWORK
from DefineConstants. NET_4_0 directives in MonoHttp are left intact (out of scope).

Co-Authored-By: Travis Myers <travis.myers@cognition.ai>
…t 2.4.2 (feature)

Co-Authored-By: Travis Myers <travis.myers@cognition.ai>
Co-Authored-By: Travis Myers <travis.myers@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants