Created
March 4, 2012 16:11
-
-
Save r-moeritz/1973703 to your computer and use it in GitHub Desktop.
ClojureCLR AssemblyResolve
This file contains 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
static Assembly ResolveAssembly(object sender, ResolveEventArgs args) | |
{ | |
var name = args.Name.Split(',').FirstOrDefault(); | |
if (String.IsNullOrEmpty(name) || name.EndsWith(".resources")) return null; | |
name = name.Replace('.', '_'); | |
var data = (byte[])Properties.Resources.ResourceManager.GetObject(name); | |
return (data == null) ? null : Assembly.Load(data); | |
} | |
static RT() | |
{ | |
AppDomain.CurrentDomain.AssemblyResolve += ResolveAssembly; | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment