I have a rather large resource (2MB) that I’m embedding into my C# application … I want to know read it into memory and then write it to disk to use it for later processing?
I’ve embedded the resource into my project as build setting
Any sample piece of code will help me startup.
You need to Stream in the resource from Disk, since the .NET Framework likely won’t load your resources until you access them (I’m not 100% sure, but I’m fairly confident)
While you stream the contents in, you need to write them back as well to disk.
Remember, this will create the filename as “YourConsoleBuildName.ResourceName.Extenstion”
For example, if your project target is called “ConsoleApplication1”, and your resource name is “My2MBLarge.Dll”, then your file will be created as “ConsoleApplication1.My2MBLarge.Dll” — Of course, you can modify it as you see fill fit.