471,071 Members | 967 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,071 software developers and data experts.

Using the Assembly.GetFile(string) method?

I have the following code:
>

Assembly asm = Assembly.LoadFrom("Foo.dll");
foreach (string s in asm.GetManifestResourceNames())
{
Console.WriteLine("found manifest resource: " + s);
}

FileStream fs = asm.GetFile( ??? );
<<<<<

Suppose I have a resource file called "Xyz.resx" embedded in the Foo.dll
assembly above. (Xyz also shows up as one of the items on the WriteLine
output too.) What should replace the '???' to generate the FileStream
properly? I've tried everything I can think of and still no dice.

Any help would be appreciated. Thanks!
Nov 16 '05 #1
1 7560
<"Kyle Kaitan" <kkaitan [at] gmail [dot] com>> wrote:
>>

Assembly asm = Assembly.LoadFrom("Foo.dll");
foreach (string s in asm.GetManifestResourceNames())
{
Console.WriteLine("found manifest resource: " + s);
}

FileStream fs = asm.GetFile( ??? );
<<<<<

Suppose I have a resource file called "Xyz.resx" embedded in the Foo.dll
assembly above. (Xyz also shows up as one of the items on the WriteLine
output too.) What should replace the '???' to generate the FileStream
properly? I've tried everything I can think of and still no dice.


Use asm.GetManifestResourceStream - and it won't return a FileStream,
just a Stream.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Sebastien Degardin | last post: by
reply views Thread by mike | last post: by
4 posts views Thread by Dev | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.