1
votes

Since I've updated my project to .net 4.8, I constantly get runtime errors (FileNotFoundException):

Die Datei oder Assembly "System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.

The error is thrown by the following line:

WebApiConfig.Register(GlobalConfiguration.Configuration);

How can I fix that? I've already installed the latest System.Net.Http DLL version via NuGet and added a junction to the web.config:

<dependentAssembly>
  <assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
  <bindingRedirect oldVersion="0.0.0.0-4.3.4.0" newVersion="4.3.4.0" />
</dependentAssembly>

This all did not help at all.

1
Did you do a clean build after modifying the config file? I think the version in the .proj file is wrong. You may need to edit the proj file and correct. To find the correct version create a new simple project with Http defined. Then open the .proj file in new project and compare the http version with old project.jdweng

1 Answers

1
votes

I found the solution in this answer. My web.config file was full of redirections of obligatory files. I found, that all my other projects based on the used template don't have those redirects. Therefore, I used the method described in the linked answer to fix it.