Hi,
I have a winforms project, and I use several files as content
resources (MS reports, RDL), located in a Reports subfolder.
At runtime I create the reports path by combining
Application.StartupFolder with Reports subfolder, but when running
from VS, the exe is in debug\bin or release\bin, and Reports is not a
subfolder of it. Right now I check the path and if it contaimns Debug
\bin or Release\bin, I remove it from path to calculate homepath, but
I'm not happy with this solution.
Is there any better, generic solution to access subfolders of project
home dir?
Thanks
Settings [Project->Options->Build->Output Path] to the ".\" solves you
problem, if \Report folder in solution folder or the projects
Also you sould see ome cool reports like this one (See
[Tools->Options->Projects And Solutions->Build And Run], if you set
[MSBuild] to "Normal")
------ Build started: Project: MDIApplication, Configuration: Debug
x86 ------
Build started 17.03.2009 23:15:38.
Target CoreResGen:
Processing resource file "Form1.resx" into
"obj\x86\Debug\MDIApplication.Form1.resources".
Processing resource file "Form2.resx" into
"obj\x86\Debug\MDIApplication.Form2.resources".
Processing resource file "Properties\Resources.resx" into
"obj\x86\Debug\MDIApplication.Properties.Resources.resources".
Target CoreCompile:
C:\Windows\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig
/nowarn:1701,1702 /platform:x86 /errorreport
rompt /define
EBUG;TRACE
/reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Data.dll
/reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Deployment.dll
/reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll
/reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll
/reference:"c:\Program Files (x86)\Microsoft Chart
Controls\Assemblies\System.Windows.Forms.DataVisualization.dll"
/reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll
/reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll
/debug+ /debug:full /filealign:512 /out
bj\x86\Debug\MDIApplication.exe
/resource
bj\x86\Debug\MDIApplication.Form1.resources
/resource
bj\x86\Debug\MDIApplication.Form2.resources
/resource
bj\x86\Debug\MDIApplication.Properties.Resources.resources
/target:winexe Form1.cs Form1.Designer.cs Form2.cs Form2.Designer.cs
Program.cs Properties\AssemblyInfo.cs Properties\Resources.Designer.cs
Properties\Settings.Designer.cs
Compile complete -- 0 errors, 0 warnings
Target CopyFilesToOutputDirectory:
Copying file from "obj\x86\Debug\MDIApplication.exe" to
".\MDIApplication.exe".
MDIApplication ->
C:\Projects\InPlaceHostingManager\MDIApplication\MDIApplication\MDIApplication.exe
Copying file from "obj\x86\Debug\MDIApplication.pdb" to
".\MDIApplication.pdb".
Target IncrementalClean:
Deleting file
"C:\Projects\InPlaceHostingManager\MDIApplication\MDIApplication\bin\x86\Debug\MDIApplication.exe".
Deleting file
"C:\Projects\InPlaceHostingManager\MDIApplication\MDIApplication\bin\x86\Debug\MDIApplication.pdb".
Build succeeded.
Time Elapsed 00:00:01.11
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========