0

I am getting a "Could not load file or assembly" error every time I build my project, and I can resolve it each time by closing the solution and deleting the .vs folder. After that I don't see any errors.

Closing my project and deleting the .vs folder gets rid of the error until I build again.

Are there any settings in VS I can check that might be causing this?

I have searched through the entire project for anything referencing a version containing 4.2 and haven't been able to find it.

The .csproj file looks like it contains the correct reference to 4.3.0 and so does the packages.config.

1 Answers1

0

Your problem looks similar to this stackoverflow question. The solution for them was to change the version in the .csproj. It is possible your problem is the same. As they said “ Originally my app.config contained:

<dependentAssembly>
  <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
  <bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" />
</dependentAssembly>

But the packages.config contained:

<package id="System.Runtime" version="4.3.0" targetFramework="net461" requireReinstallation="true" />

I modified the app.config entry to match packages.config for the newVersion:

<dependentAssembly>
  <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
  <bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.3.0" />
</dependentAssembly>

After the change, the issue was resolved.”

SupaMaggie70 b
  • 322
  • 3
  • 8