Last post Sep 08, 2005 11:40 AM by mcmcomasp
Sep 08, 2005 10:54 AM|mcmcomasp|LINK
StreamReader reader1 = new StreamReader(Assembly.GetExecutingAssembly().GetManifestResourceStream("Sbx.Mail.Resources.MimeTypes.txt"))
This is supposed to collect the MIME TYPES from a text file named, MimeTypes.txt thats located in the Resources folder of my class library.
Its properties are set to embedded resource but when i compile and run it i get a stream is null error. The problem, i think, lies in either that i created the text file wrong,
or it's not compiling as an actual resource.
All the text file has is just the values.
Thers nothing more in the text file and maybe something else is needed, i dunno. I can get it to work by bypassing the GetExecutingAssembly().GetManifestResourceStream() and replacing it with just a path to the text file for the streamreader, but since its
a class library i would like the resource embedded.
thanks in advance!
Sep 08, 2005 11:40 AM|mcmcomasp|LINK
i figured it out.
I was referencing my Resource incorrectly in GetManifestResourceStream(). It should have been SbxMail.Resources.MimeTypes.txt (the first name is the binary name, not the namespaces)
Anyhoo i got it working,