Page 1 of 1

Loading f-in-box from resource

Posted: Sun Mar 23, 2008 5:05 pm
by seesharp
Hi

we are planning a completely embedded solution where we load every .NET assembly directly from resource to deploy single file applications.
My question is simpe, is it possible to load the non .NET f-in-box .dll from resource as well ?
Otherwise we will have to extract it each time we start the application.

Regards

Alex

Re: Loading f-in-box from resource

Posted: Sun Mar 23, 2008 6:32 pm
by Softanics
Thank you for your question.

seesharp wrote:we are planning a completely embedded solution where we load every .NET assembly directly from resource to deploy single file applications.
My question is simpe, is it possible to load the non .NET f-in-box .dll from resource as well ?
Otherwise we will have to extract it each time we start the application.


Yes, I understand your task. f_in_box.dll is a managed DLL. Unfortunaly, there is no _documented_ way to load such DLLs from resource.

Posted: Sun Mar 23, 2008 7:11 pm
by seesharp
Thanks for the reply

that's not a problem at all - but I thought f-in-box or fin-in-box-lib.dll are non-managed libraries and thus cannot be used like that.

Regards

Alex

Posted: Tue Mar 25, 2008 9:16 am
by seesharp
Hi again

in the meanwhile I can load every assembly from resource except f_in_box.dll / f_in_box__lib.dll.
The problem seems to be that, when invoking methods on f_in_box__lib.dll it tries to extract f_in_box.dll which doesn't seem possible, if it has been loaded from resource.

As a work-around, I extract f_in_box__lib.dll to the filesystem on start up.
Like this, I can deploy my app as a single file but - unfortunately (at least a little bit) I end with a three file application after running it.

Best regards

Alex

Posted: Tue Mar 25, 2008 10:39 am
by Softanics
seesharp wrote:The problem seems to be that, when invoking methods on f_in_box__lib.dll it tries to extract f_in_box.dll which doesn't seem possible, if it has been loaded from resource.


Yes, because f_in_box__lib.dll needs f_in_box.dll.

f_in_box.dll is a unmanaged DLL, you can't load it from resource.

Posted: Tue Mar 25, 2008 10:55 am
by seesharp
Thanks for your reply

just out of curiosity, isn't there a call I could 'catch' and serve the f_in_box.dll from a stream just as we do with the Flash.ocx ?
It would be really cool to deploy a 'real' single file application

:D


Regards

Alex

Posted: Tue Mar 25, 2008 11:07 am
by Softanics
seesharp wrote:just out of curiosity, isn't there a call I could 'catch' and serve the f_in_box.dll from a stream just as we do with the Flash.ocx ?
It would be really cool to deploy a 'real' single file application


Yes, it's possible to write code in C# that loads f_in_box.dll from a stream, but it's a hard task :)