Second embedded resource does not get added to main DLL, but in a new language specific dll instead
I have a dll that has had an embedded resource in it for a while, called cert1.p12. It appears in Reflector under resources, and I can access it from code with no problems. However now I have added a new embedded resource called cert2.pem, I have marked it as embedded resource, and this is shown in the .csproj file. However when I compile, it does not appear in Reflector and I cannot access it from code.
However now there is a language specific resource file with the cert2 resource in it.
One thing I did notice in the compiler output:
The Csc.exe contained a line with /resource:Provided\cert1.p12,BookingClient.Provided.cert.p12 on it, but no mention of the new resource.
There was also an AL.exe line with /embed:Provided\cert2.pem,BookingClient.Provided.cert2.pem
One difference between the files one is binary and one is text.
Is the compiler somehow treating these two resources differently? How can I tell the compiler开发者_JAVA百科 that even though the file is text, it is not a language resource and should go in the main DLL. I don't even need a language specific resource dll.
Thanks a lot.
Ahh sorted it out. Instead of marking files as embedded resources, I added a resource file using the properties, and added both as files, now I don't need to convert a stream to an array myself either, I just access the array directly from the global Resources object.
I actually thought resource files were for when you do want a separate language file, but it is ideal in this case, and everything is in the main dll as I wanted.
精彩评论