Fix GetSchema EmbeddedResource: use Assembly.Load instead of AppDomain search#1623
Merged
dsyme merged 3 commits intorepo-assist/fix-issue-1310-xsd-embedded-resource-466ae4f06439984dfrom Feb 22, 2026
Conversation
…ddedResource schema Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com>
Contributor
Author
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Copilot
AI
changed the title
[WIP] Fix GetSchema for embedded XSD resources
Fix GetSchema EmbeddedResource: use Assembly.Load instead of AppDomain search
Feb 22, 2026
github-actions bot
added a commit
that referenced
this pull request
Feb 22, 2026
…n search Replace AppDomain.CurrentDomain.GetAssemblies() |> Array.find with System.Reflection.Assembly.Load(asmName), which handles assemblies not yet loaded into the AppDomain (e.g. when called from a test project). Suggested in Copilot SWE PR #1623. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
4 tasks
…f06439984d' into copilot/sub-pr-1619
775fd1a
into
repo-assist/fix-issue-1310-xsd-embedded-resource-466ae4f06439984d
dsyme
added a commit
that referenced
this pull request
Feb 23, 2026
…rce is specified for XSD schemas (#1619) * Fix #1310: GetSchema now works with EmbeddedResource for XSD schemas When XmlProvider is used with Schema and EmbeddedResource, the EmbeddedResource parameter was previously ignored at runtime because GetSchema was inside the 'if not parseResult.IsResource then' guard that suppressed it when a resource was found at design time. This fix moves GetSchema generation outside that guard and adds an IsResource branch that reads the XSD from the embedded resource at runtime using AppDomain.CurrentDomain.GetAssemblies(). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add test case for GetSchema with EmbeddedResource in XSD schemas (#1620) * Initial plan * Add test case for GetSchema with EmbeddedResource in XSD schemas Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com> * Fix GetSchema EmbeddedResource: use Assembly.Load instead of AppDomain search Replace AppDomain.CurrentDomain.GetAssemblies() |> Array.find with System.Reflection.Assembly.Load(asmName), which handles assemblies not yet loaded into the AppDomain (e.g. when called from a test project). Suggested in Copilot SWE PR #1623. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix GetSchema EmbeddedResource: use Assembly.Load instead of AppDomain search (#1623) * Initial plan * Fix CI: Use Assembly.Load instead of AppDomain.GetAssemblies for EmbeddedResource schema Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com> Co-authored-by: Don Syme <dsyme@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Don Syme <dsyme@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
GetSchema()on anXmlProviderwithEmbeddedResourcewas failing at runtime withKeyNotFoundExceptionbecauseAppDomain.CurrentDomain.GetAssemblies() |> Array.findcouldn't locate the target assembly when called from a different assembly (e.g. a test project referencing the one containing the type).Changes
Helpers.fs: ReplaceAppDomain.CurrentDomain.GetAssemblies() |> Array.find (fun a -> a.GetName().Name = asmName)withSystem.Reflection.Assembly.Load(asmName), which resolves the assembly whether or not it has already been loaded into the AppDomain.🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.