'Visual Studio Crashes When Adding a DataSet to a Report, Could not load file or assembly

When adding a Dataset to an .rdlc report using the Report Designer, Visual Studio crashes. VS leaves a failure.txt file with this error:

System.IO.FileNotFoundException: Could not load file or assembly Microsoft.Extensions.DependencyInjection.Abstractions, Version=3.1.0.0

The problem appeared when we upgraded the Intuit QuickBooks Online NuGet package (IppDotNetSdkForQuickBooksApiV3) from v8 to v14. This upgrade brought in a dozen or so other dependent packages, including the package causing the FileNotFoundException above.

We cannot add a dataset to a report nor get the properties of a dataset that’s already in the report. Obviously, this is a real show-stopper for developing reports. Does anyone have suggestions?

More Background:

This is a large web forms application that’s been in production for years. We’re using the latest version of Visual Studio, Community 2019 Version 16.6.3. We’re running under Windows 10 Pro with all updates. We see the same issue with two different developers on different PCs.

VS has the latest version of the RDLC Report Designer extension, v15.3.1. Our application is targeting .Net 4.7.2.

NuGet package “Microsoft.ReportingServices.ReportViewerControl.WebForms 150.1404.0” is installed.

NuGet package “Microsoft.Extensions.DependencyInjection.Abstractions v3.1.5” is installed. Note that the error complains about v3.1.1.0, and earlier version. I have a binding redirect in the web.config file to handle this (bindingRedirect oldVersion="0.0.0.0-3.1.5.0" newVersion="3.1.5.0").

There are about 70 other packages in this solution, and all are up to date.

Things I’ve Tried:

I’ve spent several days on this problem so far. There are several SO posts that list a similar error, but they don’t appear to apply in my case.

I’ve removed all NuGet packages, the solution’s “packages” folder, and any references in the config and csproj files. I’ve reset Windows and installed VS from scratch. I added back in only the NuGet packages that were required. No help.

If I delete the project’s bin and obj folders, relaunch VS, and rebuild the solution, VS doesn’t crash - yay! But updating a dataset doesn’t show the changes in the dataset’s fields, so it really doesn’t help. Also, if you exit and relaunch VS, the crashes are back.

I tried downgrading the offending package from v3.1.5 to the desired 3.1.0. My idea was that if a binding redirect isn’t needed, there’s no longer a problem. But when I tried this, other packages faulted with the same error, and on and on. I gave up, as there are just too many packages tied to Intuit’s IppDotNetSdkForQuickBooksApiV3.

I tried creating a new project with just an empty report and not much else. I added the Intuit package and all of its dependencies (including the offending one). Surprisingly, everything worked normally and I could add and edit datasets in the report. This makes me suspect there may be conflicts between packages, or some problem deeper in our solution. No clue as to what it might be, though.

I turned on FusionLog and reproduced the problem. I’ve attached the output of the failure.txt file.

===== Fusion Log =====

*** Assembly Binder Log Entry  (7/13/2020 @ 3:32:19 PM) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: DisplayName = Microsoft.Extensions.DependencyInjection.Abstractions, Version=3.1.5.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
 (Fully-specified)
LOG: Appbase = file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/common7/ide/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = devenv.exe
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\sandygettings\AppData\Local\Microsoft\VisualStudio\16.0_968c7791\devenv.exe.config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.Extensions.DependencyInjection.Abstractions, Version=3.1.5.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/common7/ide/Microsoft.Extensions.DependencyInjection.Abstractions.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/common7/ide/Microsoft.Extensions.DependencyInjection.Abstractions/Microsoft.Extensions.DependencyInjection.Abstractions.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/common7/ide/PublicAssemblies/Microsoft.Extensions.DependencyInjection.Abstractions.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/common7/ide/PublicAssemblies/Microsoft.Extensions.DependencyInjection.Abstractions/Microsoft.Extensions.DependencyInjection.Abstractions.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/common7/ide/PrivateAssemblies/Microsoft.Extensions.DependencyInjection.Abstractions.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/common7/ide/PrivateAssemblies/Microsoft.Extensions.DependencyInjection.Abstractions/Microsoft.Extensions.DependencyInjection.Abstractions.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/common7/ide/CommonExtensions/Microsoft/TestWindow/Microsoft.Extensions.DependencyInjection.Abstractions.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/common7/ide/CommonExtensions/Microsoft/TestWindow/Microsoft.Extensions.DependencyInjection.Abstractions/Microsoft.Extensions.DependencyInjection.Abstractions.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/common7/ide/CommonExtensions/Platform/Debugger/Microsoft.Extensions.DependencyInjection.Abstractions.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/common7/ide/CommonExtensions/Platform/Debugger/Microsoft.Extensions.DependencyInjection.Abstractions/Microsoft.Extensions.DependencyInjection.Abstractions.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/common7/ide/PrivateAssemblies/DataCollectors/Microsoft.Extensions.DependencyInjection.Abstractions.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/common7/ide/PrivateAssemblies/DataCollectors/Microsoft.Extensions.DependencyInjection.Abstractions/Microsoft.Extensions.DependencyInjection.Abstractions.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/common7/ide/PrivateAssemblies/DataCollectors/x86/Microsoft.Extensions.DependencyInjection.Abstractions.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/common7/ide/PrivateAssemblies/DataCollectors/x86/Microsoft.Extensions.DependencyInjection.Abstractions/Microsoft.Extensions.DependencyInjection.Abstractions.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/common7/ide/Microsoft.Extensions.DependencyInjection.Abstractions.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/common7/ide/Microsoft.Extensions.DependencyInjection.Abstractions/Microsoft.Extensions.DependencyInjection.Abstractions.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/common7/ide/PublicAssemblies/Microsoft.Extensions.DependencyInjection.Abstractions.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/common7/ide/PublicAssemblies/Microsoft.Extensions.DependencyInjection.Abstractions/Microsoft.Extensions.DependencyInjection.Abstractions.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/common7/ide/PrivateAssemblies/Microsoft.Extensions.DependencyInjection.Abstractions.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/common7/ide/PrivateAssemblies/Microsoft.Extensions.DependencyInjection.Abstractions/Microsoft.Extensions.DependencyInjection.Abstractions.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/common7/ide/CommonExtensions/Microsoft/TestWindow/Microsoft.Extensions.DependencyInjection.Abstractions.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/common7/ide/CommonExtensions/Microsoft/TestWindow/Microsoft.Extensions.DependencyInjection.Abstractions/Microsoft.Extensions.DependencyInjection.Abstractions.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/common7/ide/CommonExtensions/Platform/Debugger/Microsoft.Extensions.DependencyInjection.Abstractions.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/common7/ide/CommonExtensions/Platform/Debugger/Microsoft.Extensions.DependencyInjection.Abstractions/Microsoft.Extensions.DependencyInjection.Abstractions.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/common7/ide/PrivateAssemblies/DataCollectors/Microsoft.Extensions.DependencyInjection.Abstractions.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/common7/ide/PrivateAssemblies/DataCollectors/Microsoft.Extensions.DependencyInjection.Abstractions/Microsoft.Extensions.DependencyInjection.Abstractions.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/common7/ide/PrivateAssemblies/DataCollectors/x86/Microsoft.Extensions.DependencyInjection.Abstractions.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/common7/ide/PrivateAssemblies/DataCollectors/x86/Microsoft.Extensions.DependencyInjection.Abstractions/Microsoft.Extensions.DependencyInjection.Abstractions.EXE.
LOG: All probing URLs attempted and failed.

===== And here is the VS failure.txt file =====

UNHANDLED EXCEPTIONS FROM PROCESS 14132:
=====================
7/13/2020 3:32:26 PM
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=3.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=3.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
   at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
   at System.Signature..ctor(IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
   at System.Reflection.RuntimeConstructorInfo.GetParametersNoCopy()
   at System.RuntimeType.FilterApplyMethodBase(MethodBase methodBase, BindingFlags methodFlags, BindingFlags bindingFlags, CallingConventions callConv, Type[] argumentTypes)
   at System.RuntimeType.GetConstructorCandidates(String name, BindingFlags bindingAttr, CallingConventions callConv, Type[] types, Boolean allowPrefixLookup)
   at System.RuntimeType.GetConstructorImpl(BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
   at System.Type.GetConstructor(BindingFlags bindingAttr, Binder binder, Type[] types, ParameterModifier[] modifiers)
   at Microsoft.ReportDesigner.Design.DesignUtil.GetVenusObjectDataSources(XmlSchema[] schemaDataSources, IServiceProvider serviceProvider)
   at Microsoft.ReportDesigner.Data.Local.DataSetSynchronizer.<GetProjectGenericObjectDataSources>d__11.MoveNext()
   at Microsoft.ReportDesigner.Data.Local.DataSetSynchronizer.<GetSynchableDataSources>d__7.MoveNext()
   at Microsoft.ReportDesigner.Data.Local.Dialogs.Pages.DataSetGeneralPage.LoadDataSources()
   at Microsoft.ReportDesigner.Data.Local.Dialogs.Pages.DataSetGeneralPage.LoadData()
   at Microsoft.ReportDesigner.Data.Local.Dialogs.DataSetDialog.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: DisplayName = Microsoft.Extensions.DependencyInjection.Abstractions, Version=3.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
 (Fully-specified)
LOG: Appbase = file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/common7/ide/
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\sandygettings\AppData\Local\Microsoft\VisualStudio\16.0_968c7791\devenv.exe.config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: The same bind was seen before, and was failed with hr = 0x80070002.
===================

===== Update =====

Per Perry's suggestion, I created a new solution from scratch, copied all of the source files into the new projects, and installed only the NuGet packages needed. VS still crashes the same way.

Here is a list of all packages in the solution (a directory listing of the "packages" folder):

07/14/2020  01:48 PM    <DIR>          AjaxControlToolkit.20.1.0
07/14/2020  12:24 PM    <DIR>          Fizzler.1.2.0
07/14/2020  02:34 PM    <DIR>          IppDotNetSdkForQuickBooksApiV3.14.0.0
07/14/2020  04:21 PM    <DIR>          Microsoft.AspNet.Cors.5.2.7
07/14/2020  04:21 PM    <DIR>          Microsoft.AspNet.WebApi.Client.5.2.7
07/14/2020  04:21 PM    <DIR>          Microsoft.AspNet.WebApi.Core.5.2.7
07/14/2020  04:21 PM    <DIR>          Microsoft.AspNet.WebApi.Cors.5.2.7
07/14/2020  02:48 PM    <DIR>          Microsoft.Azure.DocumentDB.2.11.2
07/14/2020  02:48 PM    <DIR>          Microsoft.Bcl.AsyncInterfaces.1.1.1
07/14/2020  12:34 PM    <DIR>          Microsoft.CodeDom.Providers.DotNetCompilerPlatform.3.6.0
07/14/2020  02:48 PM    <DIR>          Microsoft.DotNet.PlatformAbstractions.3.1.6
07/14/2020  02:47 PM    <DIR>          Microsoft.Extensions.Configuration.3.1.6
07/14/2020  02:47 PM    <DIR>          Microsoft.Extensions.Configuration.Abstractions.3.1.6
07/14/2020  02:47 PM    <DIR>          Microsoft.Extensions.Configuration.Binder.3.1.6
07/14/2020  02:47 PM    <DIR>          Microsoft.Extensions.Configuration.FileExtensions.3.1.6
07/14/2020  02:48 PM    <DIR>          Microsoft.Extensions.Configuration.Json.3.1.6
07/14/2020  02:48 PM    <DIR>          Microsoft.Extensions.Configuration.Xml.3.1.6
07/14/2020  02:48 PM    <DIR>          Microsoft.Extensions.DependencyInjection.3.1.6
07/14/2020  02:47 PM    <DIR>          Microsoft.Extensions.DependencyInjection.Abstractions.3.1.6
07/14/2020  02:48 PM    <DIR>          Microsoft.Extensions.DependencyModel.3.1.6
07/14/2020  02:47 PM    <DIR>          Microsoft.Extensions.FileProviders.Abstractions.3.1.6
07/14/2020  02:47 PM    <DIR>          Microsoft.Extensions.FileProviders.Physical.3.1.6
07/14/2020  02:47 PM    <DIR>          Microsoft.Extensions.FileSystemGlobbing.3.1.6
07/14/2020  02:48 PM    <DIR>          Microsoft.Extensions.Logging.3.1.6
07/14/2020  02:47 PM    <DIR>          Microsoft.Extensions.Logging.Abstractions.3.1.6
07/14/2020  02:47 PM    <DIR>          Microsoft.Extensions.Options.3.1.6
07/14/2020  02:47 PM    <DIR>          Microsoft.Extensions.Options.ConfigurationExtensions.3.1.6
07/14/2020  02:47 PM    <DIR>          Microsoft.Extensions.Primitives.3.1.6
07/14/2020  01:48 PM    <DIR>          Microsoft.IdentityModel.JsonWebTokens.6.7.1
07/14/2020  01:48 PM    <DIR>          Microsoft.IdentityModel.Logging.6.7.1
07/14/2020  01:48 PM    <DIR>          Microsoft.IdentityModel.Tokens.6.7.1
07/14/2020  03:59 PM    <DIR>          Microsoft.ReportingServices.ReportViewerControl.WebForms.150.1404.0
07/14/2020  04:01 PM    <DIR>          Microsoft.SqlServer.Types.14.0.1016.290
07/14/2020  01:48 PM    <DIR>          Newtonsoft.Json.12.0.3
07/14/2020  01:48 PM    <DIR>          RestSharp.106.11.4
07/14/2020  02:34 PM    <DIR>          Serilog.2.9.0
07/14/2020  02:34 PM    <DIR>          Serilog.Enrichers.Environment.2.1.3
07/14/2020  02:34 PM    <DIR>          Serilog.Enrichers.Thread.3.1.0
07/14/2020  02:34 PM    <DIR>          Serilog.Extensions.Logging.3.0.1
07/14/2020  02:34 PM    <DIR>          Serilog.Settings.Configuration.3.1.0
07/14/2020  02:34 PM    <DIR>          Serilog.Sinks.AzureDocumentDB.4.0.0
07/14/2020  02:34 PM    <DIR>          Serilog.Sinks.Console.3.1.1
07/14/2020  02:34 PM    <DIR>          Serilog.Sinks.Debug.1.0.1
07/14/2020  02:34 PM    <DIR>          Serilog.Sinks.File.4.1.0
07/14/2020  02:34 PM    <DIR>          Serilog.Sinks.Literate.3.0.0
07/14/2020  02:34 PM    <DIR>          Serilog.Sinks.RollingFile.3.3.0
07/14/2020  02:34 PM    <DIR>          Serilog.Sinks.Trace.2.1.0
07/14/2020  02:34 PM    <DIR>          SerilogTraceListener.3.2.0
07/14/2020  12:24 PM    <DIR>          Svg.3.1.1
07/14/2020  02:47 PM    <DIR>          System.Buffers.4.5.1
07/14/2020  02:47 PM    <DIR>          System.ComponentModel.Annotations.4.7.0
07/14/2020  02:48 PM    <DIR>          System.Configuration.ConfigurationManager.4.7.0
07/14/2020  02:34 PM    <DIR>          System.Diagnostics.Debug.4.3.0
07/14/2020  02:34 PM    <DIR>          System.Diagnostics.TraceSource.4.3.0
07/14/2020  01:48 PM    <DIR>          System.IdentityModel.Tokens.Jwt.6.7.1
07/14/2020  02:34 PM    <DIR>          System.IO.4.3.0
07/14/2020  02:47 PM    <DIR>          System.Memory.4.5.4
07/14/2020  02:34 PM    <DIR>          System.Net.Http.4.3.4
07/14/2020  02:47 PM    <DIR>          System.Net.Http.WinHttpHandler.4.7.2
07/14/2020  02:47 PM    <DIR>          System.Numerics.Vectors.4.5.0
07/14/2020  02:47 PM    <DIR>          System.Runtime.4.3.1
07/14/2020  02:47 PM    <DIR>          System.Runtime.CompilerServices.Unsafe.4.7.1
07/14/2020  04:00 PM    <DIR>          System.Runtime.InteropServices.RuntimeInformation.4.3.0
07/14/2020  02:48 PM    <DIR>          System.Security.AccessControl.4.7.0
07/14/2020  02:48 PM    <DIR>          System.Security.Cryptography.Algorithms.4.3.1
07/14/2020  02:34 PM    <DIR>          System.Security.Cryptography.Encoding.4.3.0
07/14/2020  02:34 PM    <DIR>          System.Security.Cryptography.Primitives.4.3.0
07/14/2020  02:48 PM    <DIR>          System.Security.Cryptography.X509Certificates.4.3.2
07/14/2020  02:48 PM    <DIR>          System.Security.Cryptography.Xml.4.7.0
07/14/2020  02:48 PM    <DIR>          System.Security.Permissions.4.7.0
07/14/2020  02:48 PM    <DIR>          System.Security.Principal.Windows.4.7.0
07/14/2020  02:48 PM    <DIR>          System.Text.Encodings.Web.4.7.1
07/14/2020  02:48 PM    <DIR>          System.Text.Json.4.7.2
07/14/2020  02:48 PM    <DIR>          System.Threading.Tasks.Extensions.4.5.4
07/14/2020  02:48 PM    <DIR>          System.ValueTuple.4.5.0
07/14/2020  01:48 PM    <DIR>          Twilio.5.45.0

Here is the packages.config file in the failing project within the solution:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="AjaxControlToolkit" version="20.1.0" targetFramework="net472" />
  <package id="IppDotNetSdkForQuickBooksApiV3" version="14.0.0" targetFramework="net472" />
  <package id="Microsoft.AspNet.Cors" version="5.2.7" targetFramework="net472" />
  <package id="Microsoft.AspNet.WebApi.Client" version="5.2.7" targetFramework="net472" />
  <package id="Microsoft.AspNet.WebApi.Core" version="5.2.7" targetFramework="net472" />
  <package id="Microsoft.AspNet.WebApi.Cors" version="5.2.7" targetFramework="net472" />
  <package id="Microsoft.Azure.DocumentDB" version="2.11.2" targetFramework="net472" />
  <package id="Microsoft.Bcl.AsyncInterfaces" version="1.1.1" targetFramework="net472" />
  <package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="3.6.0" targetFramework="net472" />
  <package id="Microsoft.DotNet.PlatformAbstractions" version="3.1.6" targetFramework="net472" />
  <package id="Microsoft.Extensions.Configuration" version="3.1.6" targetFramework="net472" />
  <package id="Microsoft.Extensions.Configuration.Abstractions" version="3.1.6" targetFramework="net472" />
  <package id="Microsoft.Extensions.Configuration.Binder" version="3.1.6" targetFramework="net472" />
  <package id="Microsoft.Extensions.Configuration.FileExtensions" version="3.1.6" targetFramework="net472" />
  <package id="Microsoft.Extensions.Configuration.Json" version="3.1.6" targetFramework="net472" />
  <package id="Microsoft.Extensions.Configuration.Xml" version="3.1.6" targetFramework="net472" />
  <package id="Microsoft.Extensions.DependencyInjection" version="3.1.6" targetFramework="net472" />
  <package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="3.1.6" targetFramework="net472" />
  <package id="Microsoft.Extensions.DependencyModel" version="3.1.6" targetFramework="net472" />
  <package id="Microsoft.Extensions.FileProviders.Abstractions" version="3.1.6" targetFramework="net472" />
  <package id="Microsoft.Extensions.FileProviders.Physical" version="3.1.6" targetFramework="net472" />
  <package id="Microsoft.Extensions.FileSystemGlobbing" version="3.1.6" targetFramework="net472" />
  <package id="Microsoft.Extensions.Logging" version="3.1.6" targetFramework="net472" />
  <package id="Microsoft.Extensions.Logging.Abstractions" version="3.1.6" targetFramework="net472" />
  <package id="Microsoft.Extensions.Options" version="3.1.6" targetFramework="net472" />
  <package id="Microsoft.Extensions.Options.ConfigurationExtensions" version="3.1.6" targetFramework="net472" />
  <package id="Microsoft.Extensions.Primitives" version="3.1.6" targetFramework="net472" />
  <package id="Microsoft.ReportingServices.ReportViewerControl.WebForms" version="150.1404.0" targetFramework="net472" />
  <package id="Microsoft.SqlServer.Types" version="14.0.1016.290" targetFramework="net472" />
  <package id="Newtonsoft.Json" version="12.0.3" targetFramework="net472" />
  <package id="Serilog" version="2.9.0" targetFramework="net472" />
  <package id="Serilog.Enrichers.Environment" version="2.1.3" targetFramework="net472" />
  <package id="Serilog.Enrichers.Thread" version="3.1.0" targetFramework="net472" />
  <package id="Serilog.Extensions.Logging" version="3.0.1" targetFramework="net472" />
  <package id="Serilog.Settings.Configuration" version="3.1.0" targetFramework="net472" />
  <package id="Serilog.Sinks.AzureDocumentDB" version="4.0.0" targetFramework="net472" />
  <package id="Serilog.Sinks.Console" version="3.1.1" targetFramework="net472" />
  <package id="Serilog.Sinks.Debug" version="1.0.1" targetFramework="net472" />
  <package id="Serilog.Sinks.File" version="4.1.0" targetFramework="net472" />
  <package id="Serilog.Sinks.Literate" version="3.0.0" targetFramework="net472" />
  <package id="Serilog.Sinks.RollingFile" version="3.3.0" targetFramework="net472" />
  <package id="Serilog.Sinks.Trace" version="2.1.0" targetFramework="net472" />
  <package id="SerilogTraceListener" version="3.2.0" targetFramework="net472" />
  <package id="System.Buffers" version="4.5.1" targetFramework="net472" />
  <package id="System.ComponentModel.Annotations" version="4.7.0" targetFramework="net472" />
  <package id="System.Configuration.ConfigurationManager" version="4.7.0" targetFramework="net472" />
  <package id="System.Diagnostics.Debug" version="4.3.0" targetFramework="net472" />
  <package id="System.Diagnostics.TraceSource" version="4.3.0" targetFramework="net472" />
  <package id="System.IO" version="4.3.0" targetFramework="net472" />
  <package id="System.Memory" version="4.5.4" targetFramework="net472" />
  <package id="System.Net.Http" version="4.3.4" targetFramework="net472" />
  <package id="System.Net.Http.WinHttpHandler" version="4.7.2" targetFramework="net472" />
  <package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
  <package id="System.Runtime" version="4.3.1" targetFramework="net472" />
  <package id="System.Runtime.CompilerServices.Unsafe" version="4.7.1" targetFramework="net472" />
  <package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="net472" />
  <package id="System.Security.AccessControl" version="4.7.0" targetFramework="net472" />
  <package id="System.Security.Cryptography.Algorithms" version="4.3.1" targetFramework="net472" />
  <package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net472" />
  <package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net472" />
  <package id="System.Security.Cryptography.X509Certificates" version="4.3.2" targetFramework="net472" />
  <package id="System.Security.Cryptography.Xml" version="4.7.0" targetFramework="net472" />
  <package id="System.Security.Permissions" version="4.7.0" targetFramework="net472" />
  <package id="System.Security.Principal.Windows" version="4.7.0" targetFramework="net472" />
  <package id="System.Text.Encodings.Web" version="4.7.1" targetFramework="net472" />
  <package id="System.Text.Json" version="4.7.2" targetFramework="net472" />
  <package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
  <package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />
</packages>


Solution 1:[1]

Good news — I can edit report datasets again!

I did two things:

  • Refactored the web pages that referred to the QuickBooks Online DLLs. That code is now moved into a separate library project.
  • Used the VS extension Resharper to find and remove unused NuGet packages and project references. Probably about 40/50/60+ of those, all told.

I don’t know the actual cause of the problem. I can even add a report and a dataset within the new library and that works normally, too. My best guess is that there were conflicting NuGet packages or references, or they were somehow badly configured.

The moral of the story: Isolate QuickBooks code to a separate library, and remove all unnecessary NuGet packages and references.

This was a solid couple of days of work, but the result fixed the original problem. The entire project is cleaned up, too. (And thanks, Resharper!)

Solution 2:[2]

Visual Studio Crashes When Adding a DataSet to a Report, Could not load file or assembly

For the issue, it is more related to your old project. Since the structure and the function from the new VS2019 asp net web project is quite different from the old one from the previous version, so when you migrate your project into VS2019, it might have some issues from time to time.

Or you could try the following suggestions:

1) first, try to add the related dll into the system global assembly caches.

Run CMD as Administrator and then input these:

cd xxxxx (the path of the the Microsoft.Extensions.DependencyInjection.Abstractions 3.1.0.0) // you can find it in the Microsoft.Extensions.DependencyInjection.Abstractions nuget package version 3.1.0

gacutil /i Microsoft.Extensions.DependencyInjection.Abstractions.dll

2) close VS, delete .vs hidden folder under the solution folder, bin and obj folder

3) run update-package -reinstall on Package Manager Console

======

add this in xxx.csproj file:

 <PropertyGroup>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>

======

Then, please update all your nuget packages to the latest version since you have use the newer net framework 4.7.2. Run this on Package Manager Console:

Update-Package

======

After these, rebuild your project to try again.

Besides,

For the problem of large and old asp net web project upgrade and migration to the new version VS, due to the many nuget packages and various technologies usually involved, the upgrade process is a bit complicated, so we recommend creating a new web project in VS2019, and then directly migrate the contents of the old project into the new project.

It is just the solution you said above. It may not be ideal, but it is effective.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Sandy Gettings
Solution 2 Sayed Abolfazl Fatemi