Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Regression] Failed to discovery tests for "UITests" with error "System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types" appeared #9400

Closed
PhoebeTf opened this issue Mar 5, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@PhoebeTf
Copy link
Member

PhoebeTf commented Mar 5, 2024

Describe the bug

This is a regression issue, feature works well on 17.9, broken from 17.10.0 Preview 1.0 [34607.79.d17.10]

Steps to reproduce the bug

  1. Download the project from github microsoft/WinUI-Samples: Official repository for WinUI sample code (github.com)
  2. Extract the project and launch solution "UITests.sln"
    (Note: need update the code for "bool isCausalitySupported()" in "xx:\WinUI-Samples-main\WinUI-Samples-main\Shared\WinUISplashScreen\Native\ppltasks.cpp" as feature change mentioned in https://github.com/microsoft/WinUI-Samples/issues/193
  3. Wait for the solution load completely
  4. Add Nuget source for "https://api.nuget.org/v3/index.json" and "C:\Program Files (x86)\Microsoft SDKs\NuGetPackages" under "Package Sources" tab for "Nuget Package Manager"
  5. Restore NuGet package for solution
  6. Build project "UITests"
  7. Open Test->Test Explorer
  8. Click "Run All Tests in View"

Actual:
Only 1 test for UnitTest was found and 1 Error appeared
Fail

Error info:
Could not determine target device configuration. Exception: System.Runtime.InteropServices.COMException (0x80020009): The method or operation is not implemented.

at EnvDTE.Property.get_Value()

at Microsoft.VisualStudio.TestWindow.ShellServices.ProjectDataImpl.d__36.MoveNext()

Starting test discovery for requested test run

========== Starting test discovery ==========

System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)

at System.Reflection.RuntimeModule.GetTypes()

at System.Reflection.Assembly.GetTypes()

at System.ComponentModel.Composition.Hosting.AssemblyCatalog.get_InnerCatalog()

at System.ComponentModel.Composition.Hosting.AssemblyCatalog.GetExports(ImportDefinition definition)

at System.ComponentModel.Composition.Hosting.AggregateCatalog.GetExports(ImportDefinition definition)

at System.ComponentModel.Composition.Hosting.CatalogExportProvider.InternalGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)

at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)

at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExports(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)

at System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)

at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)

at System.ComponentModel.Composition.Hosting.AggregateExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)

at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)

at System.ComponentModel.Composition.Hosting.CompositionContainer.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)

at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)

at System.ComponentModel.Composition.Hosting.ExportProvider.GetExports(ImportDefinition definition, AtomicComposition atomicComposition)

at System.ComponentModel.Composition.Hosting.ImportEngine.TryGetExports(ExportProvider provider, ComposablePart part, ImportDefinition definition, AtomicComposition atomicComposition)

at System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImportSubset(PartManager partManager, IEnumerable`1 imports, AtomicComposition atomicComposition)

at System.ComponentModel.Composition.Hosting.ImportEngine.TryPreviewImportsStateMachine(PartManager partManager, ComposablePart part, AtomicComposition atomicComposition)

at System.ComponentModel.Composition.Hosting.ImportEngine.PreviewImports(ComposablePart part, AtomicComposition atomicComposition)

at System.ComponentModel.Composition.Hosting.ComposablePartExportProvider.Compose(CompositionBatch batch)

at Microsoft.VisualStudio.UwpTestHostRuntimeProvider.Deployer..ctor(String target, String vsInstallPath, IMessageLogger messageLogger)

at Microsoft.VisualStudio.UwpTestHostRuntimeProvider.UwpTestHostManager.get_Deployer()

at Microsoft.VisualStudio.UwpTestHostRuntimeProvider.UwpTestHostManager.Microsoft.VisualStudio.TestPlatform.ObjectModel.Host.ITestRuntimeProvider.GetTestHostProcessStartInfo(IEnumerable1 sources, IDictionary2 environmentVariables, TestRunnerConnectionInfo connectionInfo)

at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources, String runSettings) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs:line 223

at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.InitializeDiscovery(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler, Boolean skipDefaultAdapters) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyDiscoveryManager.cs:line 149

========== Test discovery aborted: 0 Tests found in 22.5 ms ==========

========== Starting test run ==========

========== Test run finished: 1 Tests (1 Passed, 0 Failed, 0 Skipped) run in 58 ms ==========

Expected behavior

6 Tests (1 for UnitTest and 5 for UITests) were found and all pass
Works

Screenshots

No response

NuGet package version

None

Windows version

No response

Additional context

No response

@PhoebeTf PhoebeTf added the bug Something isn't working label Mar 5, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Mar 5, 2024
@PhoebeTf
Copy link
Member Author

PhoebeTf commented Mar 8, 2024

Tested with 17.10.0 Preview 2.0 [34707.107.d17.10], all tests can be discovered. Close it.
Works_17 10Preview2

@PhoebeTf PhoebeTf closed this as completed Mar 8, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot removed the needs-triage Issue needs to be triaged by the area owners label Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant