I have added a DLL as a resource to my project. I need to get the file path to this DLL as I am using CSharpCodeProvider to compile something. One can only pass referenced assemblies as file paths to the ReferencedAssemblies properties of it.
I can quite easily get a byte array for my resource DLL. At the moment I write the byte array to a temp file and delete if after compilation… Isn’t there better ? To me it makes sense that this file must be somewhere and easily accessible, not only as stream of bytes.
Thanks !
The resource file does not have a path .
You need to read its contents using the
Assembly.GetManifestResourceStreamfor more information http://msdn.microsoft.com/en-us/library/xc4235zt.aspx
try this one Properties.
Resources.YOUR_RESOURCE_FILENAME