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

Take System dlls from testhost folder #4610

Merged
merged 3 commits into from Jul 18, 2023
Merged

Conversation

Evangelink
Copy link
Member

@Evangelink Evangelink commented Jul 17, 2023

Description

For TestHostNetFramework folder, embed dlls from the various net framework folders of the testhost projects rather than from netstandard library package.

Related issue

Relates to AB#1843962
Fix #4549

@nohwnd
Copy link
Member

nohwnd commented Jul 18, 2023

Tested on windows and on linux and can run tests in both.

n@RDESKTOP:~$ dotnet exec /mnt/s/p/vstest2/artifacts/packages/Debug/Shipping/Microsoft.TestPlatform.CLI.17.8.0-dev/conte
ntFiles/any/netcoreapp3.1/vstest.console.dll t/mstest2/bin/Debug/net472/mstest2.dll
Microsoft (R) Test Execution Command Line Tool Version 17.8.0-dev (x64)
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.

Passed!  - Failed:     0, Passed:     1, Skipped:     0, Total:     1, Duration: 111 ms - mstest2.dll (net472)
n@RDESKTOP:~$

@Evangelink Evangelink merged commit 1c690a6 into microsoft:main Jul 18, 2023
7 checks passed
@Evangelink Evangelink deleted the fix-mono branch July 18, 2023 15:36
@JamesNK
Copy link
Member

JamesNK commented Jul 30, 2023

Hi

Will this fix make it into .NET 8? I tested with the latest daily SDK for .NET 8 RC1, and it still fails.

Microsoft (R) Test Execution Command Line Tool Version 17.7.0-preview-23317-01+919ec8358820228cc5fa77ef000051c1d6875399 (x64)
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
Testhost process for source(s) '/home/runner/work/grpc-dotnet/grpc-dotnet/test/Grpc.Core.Api.Tests/bin/Release/net472/Grpc.Core.Api.Tests.dll' exited with error: Unhandled Exception:
System.TypeInitializationException: The type initializer for 'Microsoft.VisualStudio.TestPlatform.ObjectModel.EqtTrace' threw an exception. ---> System.TypeLoadException: Could not load type of field 'Microsoft.VisualStudio.TestPlatform.ObjectModel.PlatformEqtTrace:TraceSourceLevelsMap' (1) due to: Could not resolve type with token 01000019 from typeref (expected class 'System.Diagnostics.TraceLevel' in assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') assembly:System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 type:System.Diagnostics.TraceLevel member:(null)
   --- End of inner exception stack trace ---
  at Microsoft.VisualStudio.TestPlatform.TestHost.Program.Main (System.String[] args) [0x00033] in <e7703d16410b4b2f944f9c05b9b253d1>:0 
Error:  FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for 'Microsoft.VisualStudio.TestPlatform.ObjectModel.EqtTrace' threw an exception. ---> System.TypeLoadException: Could not load type of field 'Microsoft.VisualStudio.TestPlatform.ObjectModel.PlatformEqtTrace:TraceSourceLevelsMap' (1) due to: Could not resolve type with token 01000019 from typeref (expected class 'System.Diagnostics.TraceLevel' in assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') assembly:System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 type:System.Diagnostics.TraceLevel member:(null)
   --- End of inner exception stack trace ---
  at Microsoft.VisualStudio.TestPlatform.TestHost.Program.Main (System.String[] args) [0x00033] in <e7703d16410b4b2f944f9c05b9b253d1>:0 
. Please check the diagnostic logs for more information.

I see the version is 17.7.0 while the version that you tested is 17.8.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

.NET Framework test fails after updating to .NET 8 preview 5 SDK
3 participants