Created
February 5, 2013 10:56
-
-
Save mattbrailsford/4713719 to your computer and use it in GitHub Desktop.
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
namespace Our.Umbraco.AutoTweet.Web | |
{ | |
public class AppBase : ApplicationBase | |
{ | |
public AppBase() | |
{ | |
RegisterAssemblyReslover(); | |
} | |
private void RegisterAssemblyReslover() | |
{ | |
AppDomain.CurrentDomain.AssemblyResolve += (sender, args) => | |
{ | |
var resourceName = "Our.Umbraco.MyPackage.Assemblies." + new AssemblyName(args.Name).Name + ".dll"; | |
using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName)) | |
{ | |
if (stream == null) | |
return null; | |
var assemblyData = new Byte[stream.Length]; | |
stream.Read(assemblyData, 0, assemblyData.Length); | |
return Assembly.Load(assemblyData); | |
} | |
}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment