Merging NLog.*.dll into NLog.dll

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Merging NLog.*.dll into NLog.dll

Jarek Kowalski
Administrator
Hi!

Looks like there's a consensus that this should be done.

I came up with a quick and dirty method for the merge by embedding
NLog.*.dll files as resources in NLog.dll and loading them using
Assembly.GetManifestResourceStream() followed by Assembly.Load(byte[]).

Patch is attached (embed.diff is a patch for ExtensionUtils.cs and
embed-build.diff is a patch for NLog.build). It works both in side-by-side
situation where we have NLog.*.dll and a single merged NLog.dll.

Do you see any drawbacks of this approach? I can see two potential problems:

1. It doesn't compile on .NET CF, but since .NETCF uses conditional
compilation this shouldn't be a big issue.
2. It doesn't build automatically from VS.NET 2003 (you have to use NAnt)

Jarek

embed.diff (1K) Download Attachment
embed-build.diff (1K) Download Attachment
NLog Blog
Reply | Threaded
Open this post in threaded view
|

Re: Merging NLog.*.dll into NLog.dll

Ryan Seghers
You might consider the ilmerge tool available from Microsoft:
http://www.microsoft.com/downloads/details.aspx?familyid=22914587-b4ad-4eae-87cf-b14ae6a939b0&displaylang=en

Ryan

----- Original Message -----
From: "Jaroslaw Kowalski" <[hidden email]>
To: <[hidden email]>
Sent: Wednesday, April 19, 2006 6:02 AM
Subject: [Nlog-list] Merging NLog.*.dll into NLog.dll


> Hi!
>
> Looks like there's a consensus that this should be done.
>
> I came up with a quick and dirty method for the merge by embedding
> NLog.*.dll files as resources in NLog.dll and loading them using
> Assembly.GetManifestResourceStream() followed by Assembly.Load(byte[]).
>
> Patch is attached (embed.diff is a patch for ExtensionUtils.cs and
> embed-build.diff is a patch for NLog.build). It works both in side-by-side
> situation where we have NLog.*.dll and a single merged NLog.dll.
>
> Do you see any drawbacks of this approach? I can see two potential
> problems:
>
> 1. It doesn't compile on .NET CF, but since .NETCF uses conditional
> compilation this shouldn't be a big issue.
> 2. It doesn't build automatically from VS.NET 2003 (you have to use NAnt)
>
> Jarek
>



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Nlog-list mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nlog-list
Reply | Threaded
Open this post in threaded view
|

Re: Merging NLog.*.dll into NLog.dll

Jarek Kowalski
Administrator
Yes, I was aware of that, but we still need to be able to dynamically
load/enable various targets based on current runtime framework.

An approach I considered was annotating classes with special attributes:

[SupportedOn(OS.Windows2000)]
[NotSupportedOn(OS.Unix)]

adding classes to factories based on these attributes. That approach is
probably cleaner (embedding dlls in a dll is a bit hackish), but requires
more maintenance work in the future when new frameworks and OSes become
available.

Designing a good set of attributes and configurability, which would be
future-proof and extensible is much more difficult than I initially thought.
Any good ideas in this area always welcome. The requirement for this is the
ability to generate compatibility matrix which could be published on the web
(preferably by using current XSLT method).

Jarek

----- Original Message -----
From: "Ryan Seghers" <[hidden email]>
To: "Jaroslaw Kowalski" <[hidden email]>;
<[hidden email]>
Sent: Wednesday, April 19, 2006 4:54 PM
Subject: Re: [Nlog-list] Merging NLog.*.dll into NLog.dll


> You might consider the ilmerge tool available from Microsoft:
> http://www.microsoft.com/downloads/details.aspx?familyid=22914587-b4ad-4eae-87cf-b14ae6a939b0&displaylang=en
>
> Ryan
>
> ----- Original Message -----
> From: "Jaroslaw Kowalski" <[hidden email]>
> To: <[hidden email]>
> Sent: Wednesday, April 19, 2006 6:02 AM
> Subject: [Nlog-list] Merging NLog.*.dll into NLog.dll
>
>
>> Hi!
>>
>> Looks like there's a consensus that this should be done.
>>
>> I came up with a quick and dirty method for the merge by embedding
>> NLog.*.dll files as resources in NLog.dll and loading them using
>> Assembly.GetManifestResourceStream() followed by Assembly.Load(byte[]).
>>
>> Patch is attached (embed.diff is a patch for ExtensionUtils.cs and
>> embed-build.diff is a patch for NLog.build). It works both in
>> side-by-side
>> situation where we have NLog.*.dll and a single merged NLog.dll.
>>
>> Do you see any drawbacks of this approach? I can see two potential
>> problems:
>>
>> 1. It doesn't compile on .NET CF, but since .NETCF uses conditional
>> compilation this shouldn't be a big issue.
>> 2. It doesn't build automatically from VS.NET 2003 (you have to use NAnt)
>>
>> Jarek
>>
>



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Nlog-list mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nlog-list
NLog Blog