Open Closed

Cannot run tests after adding Identity Module source code to project #1685


User avatar
0
scott7106 created
  • ABP Framework version: v4.3.3
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace:
  • Steps to reproduce the issue:"
  1. Generated new project using ABP Suite v4.3.3
  2. Replaced packages with source code for the Identity module

I can run the tests from my project with no issues. However, any attempt to run the module tests fails. A snippet of the diagnostic log from the test run is below and indicates that it failed to load a couple of assemblies. This may be an environmental issue. However, adding an explicit reference for the offending assemblies did not resolve the issue.

Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at System.Reflection.RuntimeModule.GetTypes()
   at System.Reflection.Assembly.GetTypes()
   at Microsoft.VisualStudio.TestPlatform.Common.ExtensionFramework.TestPluginDiscoverer.GetTestExtensionsFromAssembly[TPluginInfo,TExtension](Assembly assembly, Dictionary`2 pluginInfos)
.....
TpTrace Information: 0 : 30512, 1, 2021/08/10, 11:51:26.854, 6165870832021, vstest.console.dll, Failed to create newly implemented Fakes Configurator. Reason:System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.TestPlatform.Fakes, Version=16.0.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
File name: 'Microsoft.VisualStudio.TestPlatform.Fakes, Version=16.0.0.0, Culture=neutral, PublicKeyToken=null'
   at System.Reflection.RuntimeAssembly.InternalLoad(ObjectHandleOnStack assemblyName, ObjectHandleOnStack requestingAssembly, StackCrawlMarkHandle stackMark, Boolean throwOnFileNotFound, ObjectHandleOnStack assemblyLoadContext, ObjectHandleOnStack retAssembly)
   at System.Reflection.RuntimeAssembly.InternalLoad(AssemblyName assemblyName, RuntimeAssembly requestingAssembly, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, AssemblyLoadContext assemblyLoadContext)
   at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
   at Microsoft.VisualStudio.TestPlatform.Common.Utilities.FakesUtilities.TryGetFakesCrossPlatformDataCollectorConfigurator() 


6 Answer(s)
  • User Avatar
    0
    alper created
    Support Team Director

    seems like a problem related to Visual Studio. this package doesn't belong to the ABP Microsoft.VisualStudio.TestPlatform.Fakes try to run tests via command line

  • User Avatar
    0
    scott7106 created

    Same issue whether it runs from Visual Studio or the command line using dotnet test.

  • User Avatar
    0
    scott7106 created

    The logs show it cannot load Microsoft.Bcl.AsyncInterfaces. The package for this is referenced in Volo.Abp.Account.Pro.ApplicationTests <PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="5.0.0" />

    I ran the tests from the command line using dotnet test -d test.log. You can access the log files at https://s3.amazonaws.com/software.otised/test.log.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    The package for this is referenced in Volo.Abp.Account.Pro.ApplicationTests PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="5.0.0" />

    Can you try to remove it from the csproj file?

  • User Avatar
    0
    scott7106 created

    Ok. Tried removing it from the csproj file. Everything builds ok which suggests it is not needed in the project. However, the Microsoft.Bcl.AsyncInterfaces dll v5.0 is still in the build directory. It is referenced in the Volo.Abp.Autofac package and gets added due to that.

    There was no change in the log file (shown below). It looks like something in the referenced packages is causing the process to downgrade the version of this library. I am investigating the .NET 5 packages versus the .NET Standard 2.0 packages at the moment, but have not found anything helpful to resolve this yet.

    As a curiosity question, why is there a mix of targeted frameworks in the solution? I see .NET Standard 2.0, .NET Standard 2.1 and .NET 5.0. I updated all of my source code projects to .NET 5, but that didn't change the result of these tests failing.

    TpTrace Verbose: 0 : 22248, 1, 2021/08/18, 17:57:05.996, 6546643805377, vstest.console.dll, Version: 16.11.0-release-20210626-04
    TpTrace Information: 0 : 22248, 1, 2021/08/18, 17:57:06.035, 6546644086291, vstest.console.dll, Using .Net Framework version:.NETCoreApp,Version=v5.0
    TpTrace Information: 0 : 22248, 1, 2021/08/18, 17:57:06.036, 6546644091483, vstest.console.dll, FilePatternParser: The given file C:\AppDev\otised\OtisEd.Nimble\aspnet-core\modules\Volo.Identity.Pro\test\Volo.Abp.Identity.Pro.TestBase\bin\Debug\net5.0\Volo.Abp.Identity.Pro.TestBase.dll is a full path.
    TpTrace Verbose: 0 : 22248, 1, 2021/08/18, 17:57:06.050, 6546644233328, vstest.console.dll, TestPluginCache.DiscoverTestExtensions: finding test extensions in assemblies ends with: RuntimeProvider.dll TPluginInfo: Microsoft.VisualStudio.TestPlatform.Common.ExtensionFramework.Utilities.TestRuntimePluginInformation TExtension: Microsoft.VisualStudio.TestPlatform.ObjectModel.Host.ITestRuntimeProvider
    TpTrace Verbose: 0 : 22248, 1, 2021/08/18, 17:57:06.052, 6546644248340, vstest.console.dll, TestPluginCache.GetExtensionPaths: Filtered extension paths: 
    TpTrace Verbose: 0 : 22248, 1, 2021/08/18, 17:57:06.052, 6546644250315, vstest.console.dll, TestPluginCache.GetExtensionPaths: Added default extension paths: C:\Program Files\dotnet\sdk\5.0.400\Extensions\Microsoft.Diagnostics.NETCore.Client.dll
    C:\Program Files\dotnet\sdk\5.0.400\Extensions\Microsoft.TestPlatform.Extensions.BlameDataCollector.dll
    C:\Program Files\dotnet\sdk\5.0.400\Extensions\Microsoft.TestPlatform.Extensions.EventLogCollector.dll
    C:\Program Files\dotnet\sdk\5.0.400\Extensions\Microsoft.TestPlatform.TestHostRuntimeProvider.dll
    C:\Program Files\dotnet\sdk\5.0.400\Extensions\Microsoft.VisualStudio.TestPlatform.Extensions.Html.TestLogger.dll
    C:\Program Files\dotnet\sdk\5.0.400\Extensions\Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger.dll
    TpTrace Verbose: 0 : 22248, 1, 2021/08/18, 17:57:06.052, 6546644251092, vstest.console.dll, TestPluginCache.GetExtensionPaths: Added unfilterableExtensionPaths: 
    TpTrace Information: 0 : 22248, 1, 2021/08/18, 17:57:06.053, 6546644263639, vstest.console.dll, AssemblyResolver.ctor: Creating AssemblyResolver with searchDirectories C:\Program Files\dotnet\sdk\5.0.400\Extensions,C:\Program Files\dotnet\sdk\5.0.400
    TpTrace Verbose: 0 : 22248, 1, 2021/08/18, 17:57:06.054, 6546644275498, vstest.console.dll, TestPluginCache.DiscoverTestExtensions: Discovering the extensions using extension path.
    TpTrace Verbose: 0 : 22248, 1, 2021/08/18, 17:57:06.055, 6546644278429, vstest.console.dll, TestPluginCache.GetExtensionPaths: Filtered extension paths: 
    TpTrace Verbose: 0 : 22248, 1, 2021/08/18, 17:57:06.055, 6546644279125, vstest.console.dll, TestPluginCache.GetExtensionPaths: Added default extension paths: C:\Program Files\dotnet\sdk\5.0.400\Extensions\Microsoft.Diagnostics.NETCore.Client.dll
    C:\Program Files\dotnet\sdk\5.0.400\Extensions\Microsoft.TestPlatform.Extensions.BlameDataCollector.dll
    C:\Program Files\dotnet\sdk\5.0.400\Extensions\Microsoft.TestPlatform.Extensions.EventLogCollector.dll
    C:\Program Files\dotnet\sdk\5.0.400\Extensions\Microsoft.TestPlatform.TestHostRuntimeProvider.dll
    C:\Program Files\dotnet\sdk\5.0.400\Extensions\Microsoft.VisualStudio.TestPlatform.Extensions.Html.TestLogger.dll
    C:\Program Files\dotnet\sdk\5.0.400\Extensions\Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger.dll
    TpTrace Verbose: 0 : 22248, 1, 2021/08/18, 17:57:06.055, 6546644279863, vstest.console.dll, TestPluginCache.GetExtensionPaths: Added unfilterableExtensionPaths: 
    TpTrace Verbose: 0 : 22248, 1, 2021/08/18, 17:57:06.055, 6546644280858, vstest.console.dll, TestPluginCache.DiscoverTestExtensions: Discovering the extensions using allExtensionPaths: C:\Program Files\dotnet\sdk\5.0.400\Extensions\Microsoft.Diagnostics.NETCore.Client.dll
    C:\Program Files\dotnet\sdk\5.0.400\Extensions\Microsoft.TestPlatform.Extensions.BlameDataCollector.dll
    C:\Program Files\dotnet\sdk\5.0.400\Extensions\Microsoft.TestPlatform.Extensions.EventLogCollector.dll
    C:\Program Files\dotnet\sdk\5.0.400\Extensions\Microsoft.TestPlatform.TestHostRuntimeProvider.dll
    C:\Program Files\dotnet\sdk\5.0.400\Extensions\Microsoft.VisualStudio.TestPlatform.Extensions.Html.TestLogger.dll
    C:\Program Files\dotnet\sdk\5.0.400\Extensions\Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger.dll
    TpTrace Information: 0 : 22248, 1, 2021/08/18, 17:57:06.055, 6546644283854, vstest.console.dll, AssemblyResolver.AddSearchDirectories: Adding more searchDirectories C:\Program Files\dotnet\sdk\5.0.400\Extensions,C:\Program Files\dotnet\sdk\5.0.400
    TpTrace Information: 0 : 22248, 1, 2021/08/18, 17:57:06.055, 6546644285437, vstest.console.dll, AssemblyResolver.AddSearchDirectories: Adding more searchDirectories C:\Program Files\dotnet\sdk\5.0.400\Extensions,C:\Program Files\dotnet\sdk\5.0.400
    TpTrace Information: 0 : 22248, 1, 2021/08/18, 17:57:06.056, 6546644286468, vstest.console.dll, AssemblyResolver.AddSearchDirectories: Adding more searchDirectories C:\Program Files\dotnet\sdk\5.0.400\Extensions,C:\Program Files\dotnet\sdk\5.0.400
    TpTrace Information: 0 : 22248, 1, 2021/08/18, 17:57:06.056, 6546644287421, vstest.console.dll, AssemblyResolver.AddSearchDirectories: Adding more searchDirectories C:\Program Files\dotnet\sdk\5.0.400\Extensions,C:\Program Files\dotnet\sdk\5.0.400
    TpTrace Information: 0 : 22248, 1, 2021/08/18, 17:57:06.056, 6546644288152, vstest.console.dll, AssemblyResolver.AddSearchDirectories: Adding more searchDirectories C:\Program Files\dotnet\sdk\5.0.400\Extensions,C:\Program Files\dotnet\sdk\5.0.400
    TpTrace Information: 0 : 22248, 1, 2021/08/18, 17:57:06.056, 6546644289570, vstest.console.dll, AssemblyResolver.AddSearchDirectories: Adding more searchDirectories C:\Program Files\dotnet\sdk\5.0.400\Extensions,C:\Program Files\dotnet\sdk\5.0.400
    TpTrace Information: 0 : 22248, 1, 2021/08/18, 17:57:06.057, 6546644297648, vstest.console.dll, AssemblyResolver.OnResolve: Microsoft.Diagnostics.NETCore.Client: Resolving assembly.
    TpTrace Information: 0 : 22248, 1, 2021/08/18, 17:57:06.057, 6546644298999, vstest.console.dll, AssemblyResolver.OnResolve: Microsoft.Diagnostics.NETCore.Client: Searching in: 'C:\Program Files\dotnet\sdk\5.0.400\Extensions'.
    TpTrace Information: 0 : 22248, 1, 2021/08/18, 17:57:06.058, 6546644309206, vstest.console.dll, AssemblyResolver.OnResolve: Microsoft.Diagnostics.NETCore.Client: Loading assembly 'C:\Program Files\dotnet\sdk\5.0.400\Extensions\Microsoft.Diagnostics.NETCore.Client.dll'.
    TpTrace Information: 0 : 22248, 1, 2021/08/18, 17:57:06.059, 6546644318363, vstest.console.dll, AssemblyResolver.OnResolve: Resolved assembly: Microsoft.Diagnostics.NETCore.Client, from path: C:\Program Files\dotnet\sdk\5.0.400\Extensions\Microsoft.Diagnostics.NETCore.Client.dll
    TpTrace Information: 0 : 22248, 1, 2021/08/18, 17:57:06.063, 6546644361152, vstest.console.dll, AssemblyResolver.OnResolve: Microsoft.Bcl.AsyncInterfaces: Resolving assembly.
    TpTrace Information: 0 : 22248, 1, 2021/08/18, 17:57:06.063, 6546644364715, vstest.console.dll, AssemblyResolver.OnResolve: Microsoft.Bcl.AsyncInterfaces: Searching in: 'C:\Program Files\dotnet\sdk\5.0.400\Extensions'.
    TpTrace Information: 0 : 22248, 1, 2021/08/18, 17:57:06.064, 6546644368687, vstest.console.dll, AssemblyResolver.OnResolve: Microsoft.Bcl.AsyncInterfaces: Assembly path does not exist: 'C:\Program Files\dotnet\sdk\5.0.400\Extensions\Microsoft.Bcl.AsyncInterfaces.dll', returning.
    TpTrace Information: 0 : 22248, 1, 2021/08/18, 17:57:06.064, 6546644369976, vstest.console.dll, AssemblyResolver.OnResolve: Microsoft.Bcl.AsyncInterfaces: Assembly path does not exist: 'C:\Program Files\dotnet\sdk\5.0.400\Extensions\Microsoft.Bcl.AsyncInterfaces.exe', returning.
    TpTrace Information: 0 : 22248, 1, 2021/08/18, 17:57:06.064, 6546644370633, vstest.console.dll, AssemblyResolver.OnResolve: Microsoft.Bcl.AsyncInterfaces: Searching in: 'C:\Program Files\dotnet\sdk\5.0.400'.
    TpTrace Information: 0 : 22248, 1, 2021/08/18, 17:57:06.064, 6546644371794, vstest.console.dll, AssemblyResolver.OnResolve: Microsoft.Bcl.AsyncInterfaces: Assembly path does not exist: 'C:\Program Files\dotnet\sdk\5.0.400\Microsoft.Bcl.AsyncInterfaces.dll', returning.
    TpTrace Information: 0 : 22248, 1, 2021/08/18, 17:57:06.064, 6546644373738, vstest.console.dll, AssemblyResolver.OnResolve: Microsoft.Bcl.AsyncInterfaces: Assembly path does not exist: 'C:\Program Files\dotnet\sdk\5.0.400\Microsoft.Bcl.AsyncInterfaces.exe', returning.
    TpTrace Information: 0 : 22248, 1, 2021/08/18, 17:57:06.064, 6546644374398, vstest.console.dll, AssemblyResolver.OnResolve: Microsoft.Bcl.AsyncInterfaces: Failed to load assembly.
    TpTrace Verbose: 0 : 22248, 1, 2021/08/18, 17:57:06.064, 6546644375197, vstest.console.dll, CurrentDomainAssemblyResolve: Resolving assembly 'Microsoft.Bcl.AsyncInterfaces'.
    TpTrace Information: 0 : 22248, 1, 2021/08/18, 17:57:06.065, 6546644376710, vstest.console.dll, AssemblyResolver.OnResolve: Microsoft.Bcl.AsyncInterfaces: Resolving assembly.
    TpTrace Information: 0 : 22248, 1, 2021/08/18, 17:57:06.065, 6546644377502, vstest.console.dll, AssemblyResolver.OnResolve: Microsoft.Bcl.AsyncInterfaces: Resolved from cache.
    TpTrace Verbose: 0 : 22248, 1, 2021/08/18, 17:57:06.065, 6546644378386, vstest.console.dll, CurrentDomainAssemblyResolve: Resolving assembly 'Microsoft.Bcl.AsyncInterfaces'.
    TpTrace Verbose: 0 : 22248, 1, 2021/08/18, 17:57:06.065, 6546644379237, vstest.console.dll, CurrentDomainAssemblyResolve: Failed to resolve assembly 'Microsoft.Bcl.AsyncInterfaces'.
    TpTrace Verbose: 0 : 22248, 1, 2021/08/18, 17:57:06.066, 6546644390201, vstest.console.dll, CurrentDomainAssemblyResolve: Failed to resolve assembly 'Microsoft.Bcl.AsyncInterfaces'.
    TpTrace Warning: 0 : 22248, 1, 2021/08/18, 17:57:06.093, 6546644659841, vstest.console.dll, TestPluginDiscoverer: Failed to get types from assembly 'Microsoft.Diagnostics.NETCore.Client, Version=0.2.2.41902, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.  Skipping test extension scan for this assembly.  Error: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types.
    Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
       at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
       at System.Reflection.RuntimeModule.GetTypes()
       at System.Reflection.Assembly.GetTypes()
       at Microsoft.VisualStudio.TestPlatform.Common.ExtensionFramework.TestPluginDiscoverer.GetTestExtensionsFromAssembly[TPluginInfo,TExtension](Assembly assembly, Dictionary`2 pluginInfos)
    
    
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    I don't know much, we haven't get a similar error before.

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11