-
Notifications
You must be signed in to change notification settings - Fork 10
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
Compatibility Issue with .NET Core 3.1 and .NET 6.0: System.Reflection.TargetInvocationException #66
Comments
@sethkhon it's quite strange to see this issue, everything works fine on my end. To go further with issue investigation, I would ask to create a simple test project to reproduce the issue and share with us. So many factors may be a reason, even Microsoft Test SDK. So let's start from simple reproducible project. |
@nvborisenko Thank you very much for your prompt response! I have uploaded a simple project, including a pdf showing the command execution and result: |
Before diving deeper into the issue, let me ask you: "Does it make sense to use complex command to execute tests"? I am asking, because simple Read more aboit it: It works, because |
@nvborisenko , I appreciate your guidance towards the 'dotnet test' command. However, I would like to share some feedback based on my experience. I have been using the 'vstest.console.exe' command for the past eight years in my test automation scripts without any issues. I suspect that you might have also used it successfully in the early stages of your development of the agent. I was not familiar with 'dotnet test' and had not heard of it prior to this. When I saw it listed second in the agent execution instruction, I assumed it was an alternative method, not necessarily a simpler one. From a syntax perspective, based on the instruction, they didn't appear significantly different. I believe that users could benefit from more definitive instructions. If the instructions clearly stated that the preferred method is 'dotnet test' and that 'vstest.console.exe' should be used only if the user has a specific need for it, it would provide more clarity. Thank you for your understanding and for your continued support. Best regards, |
The world is changing, we are aimed to support more as possible. RP for When we see In any case Feel free to create new issue, or even create new issue for vstest. |
System.Reflection.TargetInvocationException During the run on VS2022 using Test Explorer and TargetFramework net8.0
|
@nvborisenko Hi not sure if .net6.0 was inside the dotnet-client at the time when the issue was reported or not, but right now the same issue is coming from here .net6.0 in the target additionally, if we redirect binding for System.Runtime, we will get into "Could not load type 'System.AppDomain'" issue as, the class is located in another lib for netframework looks like if we keep .net target in any of the parent/child projects, it's not possible to load via the vstest.console.exe and consequently to run the tests with the added adapter via VS2022 Could we please remove the support of the test run in Visual Studio and use the vstest.console.exe in the readme as it's not working and cannot be working right now. Thank you |
I believe we can mitigate it. We should understand under which framework we are running (.net framework 4.8?!). The issue here is about that runner cannot dependencies. The best way to mitigate it is to ask vstest team about best practices to write custom loggers with external dependdecies. @VladimirNilov are you interested to ask it? |
@nvborisenko, thank you for taking your time and looking into this. It can be easily done and works fine after adding the binding, but the config files go directly from vstest.console.exe and should be manually changed. (Not sure if they admit to adding the changes in their repo for the binding) |
We are trying to provide our external dependencies here:
|
@nvborisenko got the idea, will check it later and provide the update. Thank you |
From theoretical perspective, if test project is targeted to |
@nvborisenko hey again, Thanks to your message, I just put the unsafe resolver in the shared resolver and it works fine without the additional changes in the vstest.console.exe.json config file
for net482 it also works but additionally it's a new question for System.Net.Http version, so I just used an old one that is compatible without additional code changes |
I am encountering an issue when attempting to use the ReportPortalLogger with .NET Core 3.1 and .NET 6.0.
My application is a simple test project that uses the ReportPortalLogger for test logging. The tests run without problems under .NET Framework 4.6.2. However, when attempting to run the same tests under .NET Core 3.1 or .NET 6.0, I encounter a System.Reflection.TargetInvocationException during the instantiation of the ReportPortalLogger.
Here is the error message:
System.IO.FileLoadException: Could not load file or assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I've tried to diagnose the issue and it seems to be related to a mismatch or incompatibility between the 'System.Runtime' assembly version that the application is trying to load and the version expected by the ReportPortalLogger or one of its dependencies.
I also noted a similar issue when using NUnit.Console.Runner with .NET Core 3.1 and .NET 6.0, suggesting a broader compatibility issue with .NET Core/.NET 6.0.
I'd appreciate any guidance or assistance you can provide. Are there known compatibility issues with .NET Core/.NET 6.0 or specific features or APIs that the ReportPortalLogger depends on that might not be fully compatible with .NET Core/.NET 6.0?
Thank you for your assistance.
The text was updated successfully, but these errors were encountered: