visual studio resource file?

  • Thread starter Thread starter Alan Zhong
  • Start date Start date
A

Alan Zhong

hi, when you add a image file into the project, how do you "link" this
file with the exe file? i notice the exe is compiled into bin\debug\,
is it possible to compile and produce the exe file inside the project
directory?
how about adding an existing item to the solution? how do the projects
access the solution items?
thankx a lot.
from alan.
 
There are several questions here:

1. image file into project: In solution explorer, add the file to the
project (right-click the project, select Add+Add-existing item etc.). Then
select the file and in the properties window set Build Action to "Embedded
Resource". You can then access the file in code using e.g
System.Reflection.GetManifestResourceStream.

2. Exe compiled into bin/debug.VS is pre-configured with appropriate
configuration options for release and debug. If you want to change the
location for a specific configuration (or all) go into project properties,
find "Configuration properties" and "Build". You can modify "Output Path".
Alternatively yur could specify a post-build event (under "common
properties" "build events" to copy the target.

3. When you add an existing item to the solution, VS copies it into the
project folder unless it is there already (or is a subfolder that has been
added). From that point VS refers to the local copy.
 
Back
Top