Visual Studio shows incorrect version warning for RestSharp, despite correct versions in packages.config

48 views Asked by At

I'm working on a solution in Visual Studio that contains two projects. Both projects use the RestSharp library, and according to the NuGet Package Manager, both are using the same version (106.15.0).

However, Visual Studio is showing a warning that the projects are using different versions of RestSharp. I've confirmed that the packages.config files for both projects list the correct version.

Severity    Code    Description Project File    Line    Suppression State   Details
Warning     Found conflicts between different versions of "RestSharp" that could not be resolved.
There was a conflict between "RestSharp, Version=106.15.0.0, Culture=neutral, PublicKeyToken=598062e77f915f75" and "RestSharp, Version=110.2.0.0, Culture=neutral, PublicKeyToken=598062e77f915f75".
    "RestSharp, Version=106.15.0.0, Culture=neutral, PublicKeyToken=598062e77f915f75" was chosen because it was primary and "RestSharp, Version=110.2.0.0, Culture=neutral, PublicKeyToken=598062e77f915f75" was not.
    References which depend on "RestSharp, Version=106.15.0.0, Culture=neutral, PublicKeyToken=598062e77f915f75" [C:\..REDACTED..\packages\RestSharp.106.15.0\lib\net452\RestSharp.dll].
        C:\..REDACTED..\packages\RestSharp.106.15.0\lib\net452\RestSharp.dll
          Project file item includes which caused reference "C:\..REDACTED..\packages\RestSharp.106.15.0\lib\net452\RestSharp.dll".
            RestSharp, Version=106.15.0.0, Culture=neutral, PublicKeyToken=598062e77f915f75, processorArchitecture=MSIL
    References which depend on or have been unified to "RestSharp, Version=110.2.0.0, Culture=neutral, PublicKeyToken=598062e77f915f75" [].
        C:\..REDACTED..\..SUBPROJECT..\bin\Debug\..SUBPROJECT_DLL
          Project file item includes which caused reference "C:\..REDACTED..\..SUBPROJECT..\bin\Debug\..SUBPROJECT_DLL".
            C:\..REDACTED..\..SUBPROJECT..\bin\Debug\..SUBPROJECT_DLL               

Here are the steps I've taken to troubleshoot this issue:

  1. Cleaned and rebuilt the solution.
  2. Manually deleted the bin and obj folders in both projects.
  3. Checked the .csproj files for any lingering references to an old version of RestSharp (none were found).
  4. Cleared the NuGet cache.
  5. Restarted Visual Studio.

Despite these steps, the warning persists. To further investigate, I loaded the resulting DLLs from both projects into dotPeek. The inspection confirmed that both DLLs are indeed referencing RestSharp version 106.15.0.

While I understand this is a warning and could potentially be ignored since both versions are confirmed to be the same, I would prefer to resolve this to maintain a clean build.

Has anyone encountered a similar issue or does anyone have suggestions on additional steps I could take to resolve this warning?

0

There are 0 answers