1) You have solution and projects:
1.1) A solution is a container for projects, but solutions can have also
files: select the solution node, right-click Add, Add New Item... and select
a Text file. The text file is added inside a node called Solution Items.
This is only a convenience during development to avoid you to use the
Windows Explorer to locate and open them. Notice that files in this node
lack the Build Action property.
1.2) A project is a container for files, most of them are source code files
(Build Action=Compile) but projects can have too non source code files, such
text files or xml files. In this case the Build Action is used to set if the
file:
1.2.1) Will be embedded in the executable when built (Build
Action=Embedded Resouce): such an icon or xml file with strings that the exe
will need at run-time but you don´t want to provide it as an external file
but embedded (there is a NET function to retrieve embedded resources at run
time).
1.2.2) Will be excluded from the executable when built (Build
Action=Content). This can happen in 2 cases:
1.2.2.1) The file is only a convenience during development.
1.2.2.2) The file will be needed at run time but it is provided
as an external file (not embedded) and therefore you will need to include
explicitly in the setup. This is your case.
I hope it's clear now.
2) Could you ellaborate this question a bit more? Who needs the path? The
setup knows the path because you have added it... and after installing the
application, the executable can know its path using
System.Reflection.Assembly.GetExecutingAssembly().Location() ...
--
Carlos J. Quintero (Visual Developer - .NET MVP)
FAQs, Knowledge Base, Files, Docs, Articles, Utilities, etc. for .NET
addins:
http://groups.yahoo.com/group/vsnetaddin/ (free join)
"Nick" <nick029@heha.net.tw> escribió en el mensaje
news:%23XZs26oiEHA.556@tk2msftngp13.phx.gbl...
[quoted text, click to view] > Hi Carlos,
>
> Thanks for your suggestions, it is helpful, but I still have some more
> questions...
>
> 1. You suggestion works, so what is the function of adding file in
> solution explorer (for convenience only? what is build action then?)
>
> 2. How to reference the path of the file after adding to the setup
project?
>
> Thanks!
>
> Nick