Fix appdomains under visual studio #12497
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When executing the FSharp.Compiler.ComponentTests under visual studio every test that relied on App Domains failed. I have no idea how long this has been going on or when it was introduced. I suspect it's been a while. I also supsect some changes in the test hosting under VS, but it could also have been changes we have done in probing I suppose.
The solution has been to add a AlreadyLoadedAppDomainResolver when creating the worker, the issue is that a FSharp.Test.Utilities.dll is loaded in an appdomain, via loadfrom. Since it is not resolvable under vs because the vs host is not in artifacts. When we create the appdomain the marshalling needs to do an assembly load. We handle this using the new AlreadyLoadedAppDomainResolver, which checks already loaded assemblies when the resolve fails.
Oh yeah and adds a new command line option to build to just build the FSharp.Compiler.ComponentTests, and re-aligns the help text:
-testCompilerComponentTests
Fixes: #12495