0

I am fairly new to .net core.After working on this error for 2 days straight I am at a complete loss at how to fix this. I am using a software SDK that interacts with our ERP. The first time I tried to run the code, the error I got was:

System.AggregateException: One or more errors occurred. (Could not load file or assembly 'System.Data.SqlClient, Version=4.6.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.)

So I realized I was missing the assembly and installed 4.6.0 and I get the following error:

The located assembly's manifest definition does not match the assembly reference

After that I tried version(4.8.0) and got the following error:

System.AggregateException: One or more errors occurred. (Field not found: 'Microsoft.Win32.Registry.DynData'.)
 ---> System.MissingFieldException: Field not found: 'Microsoft.Win32.Registry.DynData'.

Although I just tried to switch back to 4.6.0 again and now Rider is telling me its not compatible with dotnet 3.0.

I've also tried using the following in web.config:

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
        <assemblyIdentity name="System.Data.SqlClient" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="4.5.0.0" newVersion="4.6.0.0" />
    </dependentAssembly>
</assemblyBinding>

Any help is appreciated.

Ryan
  • 303
  • 5
  • 16
  • Enable [Fusion logging](https://stackoverflow.com/questions/255669/how-to-enable-assembly-bind-failure-logging-fusion-in-net) which will log each step in resolving and binding assembly references. – John Wu Feb 08 '20 at 03:27
  • @JohnWu Thanks, Do you know if there is a way to get this to work with Jetbrains Rider IDE? – Ryan Feb 08 '20 at 05:33

1 Answers1

0

I've had luck with disabling one of Rider's default settings Disable JIT optimization on module load. My solution built just fine, and debug launched fine, but when trying to browse I got the "Could not load file or assembly" error. Try un-ticking the setting.

Documentation: https://www.jetbrains.com/help/rider/Settings_Debugger.html#dotNet

R-D
  • 566
  • 6
  • 13