Skip to content

Add AssemblyResolve handler for in-memory assemblies in CodeTaskFactory - #1486

Merged
AndyGerlicher merged 2 commits into
dotnet:xplatfrom
jeffkl:954-inlinetask
Dec 18, 2016
Merged

AndyGerlicher merged 2 commits into
dotnet:xplatfrom
jeffkl:954-inlinetask

Conversation

@jeffkl

@jeffkl jeffkl commented Dec 15, 2016 •

Copy link
Copy Markdown
Contributor

We know that since the assembly is loaded via Assembly.Load(byte[]), it is not allowed to use loaded dependencies because they came from a different load context. This change keeps a static dictionary around with a mapping of assembly strong name and assembly. If the inline task asks for the dependency at run time, the assembly resolve handler will return the loaded assembly if the strong name is the same.

Users will still experience runtime exceptions if they only list top-level dependencies in their <Reference /> list. To get around this, they'll need to list the full closure of dependencies that are not in the GAC or the MSBuild.exe directory.

Closes #594

@AndyGerlicher
AndyGerlicher merged commit 2021769 into dotnet:xplat Dec 18, 2016
@jeffkl
jeffkl deleted the 954-inlinetask branch December 20, 2016 00:12
@am11 am11 mentioned this pull request Jan 19, 2017
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.

4 participants