After updating from version 111.2 to 111.3, a C++/CLI project that uses libraries that use Restsharp reports a C2870
還沒有人認領這個 Issue。
評估
研究方向
從報告的重現開始:使用 RestSharp 111.3.0 作為相依項目的 .NET 8 C# Class Library,以及參照它的 CLR Class Library (.NET) 專案。比較使用 RestSharp 111.2.0 和 111.3.0 時的 C++/CLI 建置,然後驗證升級後 C2870 錯誤不再發生,而不依賴降級這項因應方案。
由索引模型根據 Issue 內容生成。
描述
We use a C++/CLI project as a bridge between a native C++ application (Embacadero C++ Builder) and a .Net 8 project (the C++/CLI library provides a C interface for the C++ application, which in turn is used to call partial functionality of project parts that have already been migrated to .Net).
This worked as long as our .Net libraries used at most version 111.2.0 of Restsharp. With the update to 111.3.0, the C++/CLI project throws several C2870 errors:
"C2870 'RestSharp': a namespace definition must appear either at file scope or immediately within another namespace definition <...>.nuget\packages\restsharp\111.3.0\lib\net8.0\RestSharp.dll"
Current workaround: RestSharp downgrade to 111.2
To Reproduce
- Create a new solution with a "C# Class Library" (I use .net 8), add Restsharp 111.3.0 per nuget as Dependency
- Add a new "CLR Class Library (.NET)"-Project, add the C#-Assembly as Dependency
- Build => C2870
- Downgrade the Restsharper-nuget to 111.2.0
- Build => Success
Expected behavior
The upgrade from 111.2.0 to 111.3.0 should not cause an error
Desktop (please complete the following information):
- OS: Microsoft Windows 11 Pro (Build 10.0.22631)
- .NET 8
- RestSharp Version 111.2.0 and 111.3.0
- 主要語言
- C#
- 星號
- 9.8k
- 分支
- 2.3k
- 平均合併
- 20 分鐘
- 30 天內合併 PR
- 1
環境準備
在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
restsharp/RestSharp 的其他 Issue
-
RestClientOptions.UserAgent missing from requests with useClientFactory: true可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉bug
難度 2/5 1-3 小時 新手友好度 72/100
-
feature-request
難度 4/5 3-5 天 新手友好度 45/100
-
Default AutomaticDecompression = All routes responses through the Brotli decoder affected by CVE-2026-111497可能重新可做 關聯的 PR 已關閉且未合併。 未關閉bug
難度 2/5 1-3 小時 新手友好度 35/100
-
bug
難度 4/5 3-5 天 新手友好度 48/100
-
feature-request rfc
難度 5/5 一週以上 新手友好度 25/100
查看 restsharp/RestSharp 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 62/100
RadicalCSG/com.chisel#192 ·
維護者通常 1 天內回覆
-
area-testing p2-post-1.0 technical-debt
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
Bug good first issue
難度 2/5 1-3 小時 新手友好度 72/100
RazorConsole/RazorConsole#447 ·
維護者通常 1 天內回覆
-
bug P3
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
godot good first issue
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 2 天內回覆