Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After updating from version 111.2 to 111.3, a C++/CLI project that uses libraries that use Restsharp reports a C2870 #2233

Open
xenexelen opened this issue Jun 28, 2024 · 1 comment
Labels

Comments

@xenexelen
Copy link

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

  1. Create a new solution with a "C# Class Library" (I use .net 8), add Restsharp 111.3.0 per nuget as Dependency
  2. Add a new "CLR Class Library (.NET)"-Project, add the C#-Assembly as Dependency
  3. Build => C2870
  4. Downgrade the Restsharper-nuget to 111.2.0
  5. 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
@xenexelen xenexelen added the bug label Jun 28, 2024
@xenexelen
Copy link
Author

Error also in 111.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant