-
-
Notifications
You must be signed in to change notification settings - Fork 274
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
Costura for an SDK #27
Comments
Is app 2 using fluent directly? Costura uses the module initializer to hook itself up. If the module is not initialized before you try to use a reference to Fluent then the AssemblyResolve is not attached properly. To fix this you just need to invoke the module initializer. Here are the ways I know how, assuming
|
That's what I am doing, trying to load a type that not directly requires this assembly and wrote the name to console: Console.WriteLine(typeof(Foo).Name); However, it might be a good feature to have something like: CosturaInitializer.Force(); |
At first I thought that was a good idea too, but there's a few issues.
|
Good thoughts ;-)
|
The default namespace of the app is a setting in the project, and isn't transferred to the assembly, so Costura won't know it. Without a namespace if 2 costura libraries include the same type then one of the references has to have a different alias because the fully qualified name will be the same. http://msdn.microsoft.com/en-us/library/ms173212.aspx Why are you using Costura to embed referenced assemblies for libraries? Why do you need to package everything into one dll? If you're using Costura to abstract away internals, then why are you directly accessing those internals? Surely instead of accessing the internal you should be accessing your library that has hidden the internals anyway. |
We provide a way to use the orchestra (like a VS shell). I don't want users to have to download every external component we use. So everything that isn't required explicitly by the user is packed into the assembly so we can distribute a single assembly instead of a list of packages. |
Orchestra isn't available through nuget? |
Of course it is, but some of it's components not / contains bugs we need to hotfix because authors are too slow. |
Ok. You could include the hotfix versions in your Orchestra nuget package, instead of using Costura. It's easier for you to decide on a name for the initialize type and method and add it to Orchestra than for Costura to add it and potentially have that name collide across multiple projects. I'd be interested in the all-father @SimonCropp's opinion. Can Fody get the default namespace for a project? Is that the correct way to go? |
not at the metadata level. So if is really needed perhaps pass the project file path to the weaver? |
Hmmm, passing in the project name might be interesting anyway (never know where you need it for, and won't hurt either). |
It looks lik the IncludeAssemblies works correctly, I will close this issue. |
I am having troubles getting it to work ATM.
I have this setup:
In the app (no 2), I get issues that Fluent cannot be loaded. However this is available in the SDK (1), packaged by costura.
I expected this (in the SDK) to work:
public static void Attach()
{
AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(AssemblyLoader.ResolveAssembly);
}
But it seems not?
The text was updated successfully, but these errors were encountered: