Hello @Juan-4116,
Thank you for taking time to post this issue in Microsoft Q&A forum.
Looks like this issue is caused by the VS Update, as nothing was changed except updating VS.
One method to double confirm this is to roll back VS to the previous version that you were using and was working fine. If this issue disappears, then probably the VS update causes this issue.
I have checked the release notes of Visual Studio 2022 version 17.12.2 and version 17.12.1. I don’t see any information about the changings for these dll files. I notice that this specific dll file(System.ServiceModel.Http
) is included in this NuGet package(System.ServiceModel.Http).
As the error message says that the version 4.6.0.0 of this dll file was failed to load, please try to install the version 4.6.0 of this NuGet package and rebuild your project, see if the error disappears.
Please also open the packages.config file in your project(if your project is based on .NET Framework), see if this NuGet package is included correctly, for example <package id="System.ServiceModel.Http" version="4.6.0" targetFramework="netxxx" />
. Also, right-click your project, click Unload Project, right-click it again, select Edit Project File to open your project file. See if the dll file is included correctly, for example
<Reference Include="System.ServiceModel.Http, Version=4.6.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxxxxx, processorArchitecture=MSIL"
<HintPath>..\packages\System.ServiceModel.Http.4.6.0\lib\net461\System.ServiceModel.Http.dll</HintPath>
</Reference>
Sometimes, after updating VS, some cache files may cause the error to wrongly prompt. I suggest you also try to clean cache files(rename the bin, obj and the hidden .vs folders) and then rebuild your project.
However, I do believe that this issue is caused by the update of VS. So, I would suggest you also report this issue to Visual Studio Product Team by clicking Help > Send Feedback > Report a Problem to raise a ticket on our Developer Community and attach the related error/event logs.
By the way, if installing the NuGet package and removing the cache files don’t work, rolling back or using a previous version of Visual Studio 2022 should be a temporary workaround.
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.