Blog of Chat

March 19, 2008

Versioning/Deploying Unmanaged Files

An unmanaged dll can be wrapped in a managed assembly by adding it as a file of a multi-module assembly. Then, it can be deployed and versioned in the same way as managed assemblies. (So, that assembly could contain nothing but metadata and unmanaged code - no managed code, if you prefer. It can also contain multiple unmanaged files in the same assembly.)

If your compiler does not support this directly, you can get this to work by adding that file as a linked managed resource. For example, see Visual Studio’s /linkresource option (if using it for command line compiling).

This is useful in the case where DllImport() is used to access a function in that file. That call should be updated with the new assembly’s info. For example, in the place of “unmanagedfile.dll”, change it to include the display name like this: “unmanagedfile.dll, managedassembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″.

Live Chat Software: Next generation of Live Chat. On-Demand. Easy-to-Use.

Also see: The Internet is Officially Dead & Boring - Its the economy stupid !

Also see: Implied tags in the IE HTML parser and how that can be interesting.

If that unmanaged file needs to be loaded by LoadLibrary() outside of DllImport(), however, it will need to follow the rules of LoadLibrary(), like the usual unmanaged file use outside the CLR. (See Junfeng’s blog for an extra tip regarding that when using v2.)


http://blogs.msdn.com/suzcook/archive/2004/10/28/versioning-deploying-unmanaged-files.aspx

Comments »

The URI to TrackBack this entry is: http://spacechat.blogsome.com/2008/03/19/versioningdeploying-unmanaged-files-2/trackback/

No comments yet.

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Anti-spam measure: please retype the above text into the box provided.

Get free blog up and running in minutes with Blogsome
Theme designed by Jay of onefinejay.com