how to solve conflict issue of system.web.http on framework 4.5

Ados Biz 1 Reputation point
2022-11-21T16:07:43.757+00:00

I'm trying to open an old proyect in my new VisualStudio 2022, ( it was made in VS2017). And I get the warnning:

Found conflicts between different versions of "System.Web.Http" that could not be resolved.

There was a conflict between "System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" and "System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35".

"System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" was chosen because it was primary and "System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" was not.

References which depend on "System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" [D:\Projects...\bin\System.Web.Http.dll]. D:\Projects...\bin\System.Web.Http.dll

Project file item includes which caused reference

"D:\Projects...\bin\System.Web.Http.dll".

System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL

References which depend on "System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35".

D:\Projects\Partes-2022-2\Partes\bin\Kendo.Mvc.dll

Project file item includes which caused reference "D:\Projects...\bin\Kendo.Mvc.dll". Kendo.Mvc, Version=2015.3.1111.545, Culture=neutral, PublicKeyToken=121fae78165ba3d4, processorArchitecture=MSIL

I have no idea How to fix it.

Thanks

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
41,908 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 32,861 Reputation points Microsoft Vendor
    2022-11-22T10:05:59.833+00:00

    Hello @Ados Biz ,

    Welcome to Microsoft Q&A forum.

    If you try to add <bindingRedirect oldVersion="XXXX" newVersion="XXXX" /> into your project’s project file(.xxproj file), will this error disappear?

    See this document: <bindingRedirect> Element for details.

    Feel free to contact us.

    Best Regards,
    Tianyu

    • If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
      Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.