Solved C# Embedded Resource Copy to output directory

September 19, 2011 at 05:39:09
Specs: Windows 7, 4GB
C# Embedded Resource Copy to output directory

I have files in my project which are set as embedded resources (pdf and htm files). I have also the value copy to output directory - copy if newer. This copies all files to a sub directory called resources (within Debug or Release) on compiling the project. However I want this to happen when just running the executable, any ideas?


See More: C# Embedded Resource Copy to output directory

Report •


✔ Best Answer
September 19, 2011 at 14:51:31
And the provided links (that provided example code, no less) were unable to help?

How To Ask Questions The Smart Way



#1
September 19, 2011 at 06:15:07
Actually I just realised I need to embed these pdf / htm files properly as method above only works on compiling. Basically I want them to included in the exe (executable) file, but i am unsure how to do it.

Report •

#2
September 19, 2011 at 09:45:57
I'm not entirely sure of the question. Are you asking about embedding resources, or saving resources as files?

How To Ask Questions The Smart Way


Report •

#3
September 19, 2011 at 13:09:44
Embedding resources. I've added the file (htm) as resource but unsure how to access it

Report •

Related Solutions

#4
September 19, 2011 at 14:51:31
✔ Best Answer
And the provided links (that provided example code, no less) were unable to help?

How To Ask Questions The Smart Way


Report •

#5
September 20, 2011 at 06:03:58
I managed to use these embedded htm files using this code:
System.Reflection.Assembly thisExe;
thisExe = System.Reflection.Assembly.GetExecutingAssembly();
System.IO.Stream fileIn = thisExe.GetManifestResourceStream("InfoNet.Resources.LoadingHomePage.htm");
this.Browser.DocumentStream = fileIn;

Report •


Ask Question