Structural fix the issue "Could not load file or assembly" in the Visual Studio Extension #977
Replies: 6 comments 26 replies
-
|
@gasparnagy are there anu ideas to load the assemblies in another way? |
Beta Was this translation helpful? Give feedback.
-
|
Let me summarize the problem and the possible approaches that have been considered in the past, because I am afraid that you don't have the full picture and therefore you are not necessarily optimizing in the right direction. Long post alert... How the binding discovery works in VS extension right nowThere are also some legacy approaches but currently the most of the "binding discovery" is done via the "generic reqnroll connector" (https://github.com/reqnroll/Reqnroll.VisualStudio/tree/main/Connectors/Reqnroll.VisualStudio.ReqnrollConnector.Generic). This basically works in the following way:
This connector model generally supports test assemblies depending on different versions of assemblies than Reqnroll itself. In that case the "deps.json" file of the test assembly contains the calculated dependency versions and the connector will load that. The problem is that for some tricky dependency combinations are simulated loading resolution does not work correctly. The current connector can handle the most project needs. I can have an exact value from the telemetry but it most be something above 95%. Why do we load the binding information from the compiled test assemblyLoading the binding details seems to be an easy task: just go through the types and look for the
For the reasons above at some point we decided to only keep the runtime binding discovery but that comes with the price of the need to execute the binding discovery logic on the compiled test assembly. Options that have been considered so farWhen considering improved options, we can generally choose from two main strategies:
The concrete options that I have seen or considered:
|
Beta Was this translation helpful? Give feedback.
-
|
Here is a reproduction of not working step navigation with .Net 10 and MSDI: https://github.com/Obelixx/ReqnrollTestOnDotNet10AndMSDI |
Beta Was this translation helpful? Give feedback.
-
|
For the specific situation of failed loading of attributes from the GAC, I've put together PR #1006. This simply puts a try/catch around calls to .GetCustomAttributes() so that we can continue processing rather than hard-failing. Let me know what you think. |
Beta Was this translation helpful? Give feedback.
-
|
The refactoring of the connector is completed. The dev workflow should be much easier now. Additional testing tools:
Now I will make a PR for my one-line fix, but there is a problem with it anyway... I will comment it to the PR. |
Beta Was this translation helpful? Give feedback.
-
|
Update: We have made two small (but hopefully effective) step to address this problem:
This two steps fixed the two problems that we had a repro for, but hopefully even more. Let's see. I will ask the issue submitters to re-test their problems on Friday, because it takes a few days to have the new Visual Studio extension to be auto-updated to all users. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I know this isn't easy, but there are many reports regarding this issue. It would be great if we could structural fix this issue.
Maybe also useful, this analysis: reqnroll/Reqnroll.VisualStudio#75 (comment)
Beta Was this translation helpful? Give feedback.
All reactions