-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ship with task that packs as resource. #59
Comments
This is IL-weaving a module initializer to resolve assemblies from resources? I'd want to make a standalone package for this if it was me. |
Stand alone to make it opt-in? |
Standalone NuGet package that does absolutely nothing else |
Maybe that's too hard. Starting small might be better. |
I actually really do want to do this. You might have successfully nerd-sniped me |
We could start with the merged package Gu.Roslyn.Extensions only. A single dll, maybe it will not be insanely complicated.
|
@JohanLarsson There's a bit of a problem. You'll need to target a framework that has AppDomain.AssemblyResolve or AssemblyLoadContext.Default.Resolving. https://docs.microsoft.com/en-us/dotnet/api/system.appdomain.assemblyresolve#applies-to Min .NET Standard 2.0/.NET Core 2.0/.NET Framework 1.1. (.NET Core 2.1 is the earliest version supported by Microsoft.) |
Ah, we save it for next version then. Plan is to bump to roslyn 3, netstandard 2 & C#8 soon. Not that C#8 has anything to do with this. |
We could potentially hack around the missing event with a try-catch: try
{
_ = typeof(TypeInResourceAssembly);
}
catch (SomeException e)
{
using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Some.dll"))
{
var bytes = new byte[(int)stream.Length];
stream.Read(bytes, 0, (int)stream.Length);
Assembly.Load(bytes);
}
} Not elegant but may work. |
Ah, eager load. Hmm. |
@jnm2 if you feel like flexing some mad skills!
The text was updated successfully, but these errors were encountered: