Obtaining an embedded resource in a single DLL consisting of multiple class libraries

my solution has multiple projects and in one of them I have code to get an embedded resource (xml file) from another project. This all works great when all projects are separate. However, when all the class libraries are embedded in one dll, the code to get the resource file does not work, i.e. it cannot get the emebedded resource. I was wondering if the links to the emebedded resource get mixed up when combined together into one dll ??

I am using Assembly.GetCallingAssembly () method. GetManifestResourceStream ("namespace..filename");

+1


source to share


1 answer


I would not use Assembly.GetCallingAssembly (). I would use typeof (SomeClassNextToXmlFile). The assembler this way, if you call a DLL with an embedded resource from an exe file, it won't look in the exe for the resource. Also you can try using Reflector and make sure the resource you are looking for is where you think it is.



+1


source







All Articles