3

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>
Sandy Gettings
  • 693
  • 5
  • 21
  • [This answer from user **Chartreugz** helped me to fix this issue in VS 2019](https://stackoverflow.com/a/63836413/2992902) – Lokesh Oct 27 '21 at 14:13

2 Answers2

3

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!)

Sandy Gettings
  • 693
  • 5
  • 21
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.

Sayed Abolfazl Fatemi
  • 3,678
  • 3
  • 36
  • 48
Mr Qian
  • 21,064
  • 1
  • 31
  • 41
  • Thanks for the suggestions, Perry, but no solution yet. For your first suggestion, putting the assembly into the GAC, I found that Microsoft.Extensions.DependencyInjection.Abstractions.3.1.6 doesn't have a DLL for Net 4.7.2. The only folder inside the lib folder are "netstandard2.0". Shouldn't there be a separate DLL for 4.7.2 (or 4.5 or whatever)? – Sandy Gettings Jul 14 '20 at 21:14
  • I added "true" to the csproj file, and that didn't help, either. – Sandy Gettings Jul 14 '20 at 21:17
  • I tried creating an entirely new solution in VS, copying only the source files from the original projects, and installing only the necessary packages. All packages are up-to-date with the latest versions. VS still crashes. – Sandy Gettings Jul 14 '20 at 21:18
  • `netstandard2.0` aslo targets both of net framework and net core. See [this document](https://learn.microsoft.com/en-us/dotnet/standard/net-standard). So it uses for net framwork 4.7.2. And you can see in the `xxx.csproj` file and the `hintpath` node used the dll from net standard folder. So I think you could just `gacutil /i `. And do you still get the error after after this step? – Mr Qian Jul 15 '20 at 10:46
  • For your third commnet, it seems that you have faced the same error in the new project. Quite strange, please share this small sample with us or just share all the nuget packages and their versions with us. And it could help us troubleshoot this issue. – Mr Qian Jul 15 '20 at 10:47
  • Yes, I tried the DLL in netstandard2.0, and we still saw the same error. – Sandy Gettings Jul 15 '20 at 14:14
  • I've edited my post to include lists of the "packages" folder for the solution and the "packages.config" file in the project where the crash is happening. And I appreciate your help so far! – Sandy Gettings Jul 15 '20 at 14:53
  • I did not crash in my side and it is quite strange. Please try to disable any other vs extensions under `Extensions`-->`Mange Extensions` if you have any third party extensions which may have some impact on vs usage. [clean nuget caches](https://learn.microsoft.com/en-us/nuget/consume-packages/managing-the-global-packages-and-cache-folders#clearing-local-folders) , then Run `update-package -reinstall` under `Package Manager Console`. – Mr Qian Jul 17 '20 at 06:59
  • Also, use the new `packagereference` format rather than packages.config may have some advantages. When you use it, please make a backup to your original project. Then delete bin and obj folder, right-click on the `packages.config` file-->`migrate packages.config to PackageReference` to test it. – Mr Qian Jul 17 '20 at 07:02
  • Hi, Perry, I appreciate your help so far! I disabled all extensions (Live Share, Intellicode, MS Library Manager, GitHub Extension), leaving only MS RDLC Report Designer enabled. I cleaned and reinstalled, but I still have the same problem. Also, I can't migrate, " Operation failed. Project is not eligible for migration. Either the project is not packages.config based or doesn't support PackageReference yet." – Sandy Gettings Jul 17 '20 at 20:42
  • Maybe you can try to create a net core web application and then install these packages with PackageReference:) – Mr Qian Jul 21 '20 at 10:13
  • Thanks for the suggestion, but I don't think we'll switch to net core at this time. It would be a big change for the application, and MS generally recommends that net framework applications stick with framework rather than switching to core. I mean, if it's switch or die, we'll switch, but I hope we can solve this issue without being drastic. – Sandy Gettings Jul 22 '20 at 20:52
  • Maybe there is an extra,redundant suggestion: try another pc to test whether the issue persists. – Mr Qian Jul 24 '20 at 10:12
  • Yep, already did that. Both PCs have the same problem. It seems to be something within our project, and brought on by the newer IppDotNetSdkForQuickBooksApiV3 package or one of its many dependencies packages. – Sandy Gettings Jul 24 '20 at 18:22
  • Maybe you could provide a small sample of your project. – Mr Qian Jul 28 '20 at 10:12
  • Unfortunately, the project is too much big to do that. We're looking at either moving all of the QuickBooks code (that requires IppDotNetSdkForQuickBooksApiV3) to separate library from any reports, or trying to build up the application from a brand new empty project. The first method is just a workaround, and the second may be an actual solution (or not). Lots and lots of work in either case. – Sandy Gettings Jul 29 '20 at 15:01
  • Thanks for your efforts, Perry. I was able to finally solve this issue -- see my notes in my self-answer above. – Sandy Gettings Aug 05 '20 at 17:47