Skip to content

feature: Migrate RestSharp to target .NET Framework 4.8#16

Open
devin-ai-integration[bot] wants to merge 1 commit into
masterfrom
devin/1781115207-net48-migration
Open

feature: Migrate RestSharp to target .NET Framework 4.8#16
devin-ai-integration[bot] wants to merge 1 commit into
masterfrom
devin/1781115207-net48-migration

Conversation

@devin-ai-integration

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

Copy link
Copy Markdown

Summary

Retargets the RestSharp core library and test projects from .NET 3.5/4.0 to .NET Framework 4.8 and removes the legacy RestSharp.Net2 project, which existed only to backport features (LINQ + System.Xml.Linq) that ship in 4.8. Verified with mono xbuild (all projects build) and the xUnit console runner: 83/83 unit tests pass.

Project retargeting

  • RestSharp.csproj: v3.5v4.8; removed <TargetFrameworkProfile>Client</TargetFrameworkProfile> (no Client Profile in 4.x), removed the <RequiredTargetFramework>3.5</RequiredTargetFramework> hints on System.Core / System.ServiceModel.Web / System.Xml.Linq, dropped the 3.5-SP1 BootstrapperPackage entries, and removed the duplicate Microsoft.CSharp.targets import ($(MSBuildBinPath) one; kept $(MSBuildToolsPath)). DefineConstants left as TRACE;DEBUG;FRAMEWORK.
  • RestSharp.Tests.csproj / RestSharp.IntegrationTests.csproj: v4.0v4.8.

Dependency upgrades

  • Newtonsoft.Json 4.x13.0.3 (lib\net45), reference + packages.config + nuspec dependency range [13.0.3,).
  • xUnit 1.9.x2.4.2. References switched to xunit.core / xunit.assert / xunit.abstractions (+ xunit.execution.desktop, required so the v2 console runner can discover/run the desktop test assembly). Test sources needed no code changes (only Assert.*/[Fact] are used; no PropertyData/DoesNotThrow/xunit.extensions).

Removed RestSharp.Net2 project

  • Deleted RestSharp.Net2/ (LinqBridge + 28-file System.Xml.Linq reimplementation) and its packages.config; removed the project from both RestSharp.sln and the renamed RestSharp.Net2.slnRestSharp.Net48.sln; dropped its entry from packages/repositories.config.

Conditional compilation cleanup

The NET_2_0/Net2 symbols are now never defined, so the dead branches were removed (kept FRAMEWORK blocks, which still distinguish Silverlight/WP/Mono targets):

-#if NET_2_0
-[assembly: AssemblyCompany(".../RestSharp-.NET-2.0-Fork")]
-#else
 [assembly: AssemblyCompany("restsharp.org")]
 [assembly: AssemblyCopyright("Copyright © RestSharp Project 2009-2011")]
-#endif
-#if Net2
-using RestSharp.Contrib;
-#endif

(Only these two files in this fork actually referenced NET_2_0/Net2; the broader file list in the request reflects upstream RestSharp, not this fork.)

Notes / out of scope

  • The other platform projects (Silverlight, WindowsPhone, Mono*) and RestSharp.Mono.sln were left untouched — they are separate platform targets, not part of the 4.8 retarget.
  • Integration tests rely on live/local HTTP servers and were not run as part of the unit-test gate.
  • The committed packages/ folder (the repo vendors its NuGet packages) was updated: added the Newtonsoft 13.0.3 + xUnit 2.4.2 package set and removed the now-unused 4.x/1.x packages.

Test plan

xbuild /p:Configuration=Release RestSharp/RestSharp.csproj
xbuild /p:Configuration=Release RestSharp.Tests/RestSharp.Tests.csproj
xbuild /p:Configuration=Release RestSharp.IntegrationTests/RestSharp.IntegrationTests.csproj
mono packages/xunit.runner.console.2.4.2/tools/net452/xunit.console.exe \
  RestSharp.Tests/bin/Release/RestSharp.Tests.dll -parallel none
# => Total: 83, Errors: 0, Failed: 0, Skipped: 0

Link to Devin session: https://app.devin.ai/sessions/29818d0169444e82a3eca9a1f16d0ae6
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)

Remove the legacy RestSharp.Net2 project (LinqBridge + System.Xml.Linq
polyfills) and retarget RestSharp, RestSharp.Tests and
RestSharp.IntegrationTests to v4.8. Drop NET_2_0/Net2 conditional
compilation, upgrade Newtonsoft.Json to 13.0.3 (net45) and xunit to
2.4.2, and update solution/nuspec metadata accordingly.

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