473,396 Members | 2,023 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Add folder to project...

Hi,

I want to add a folder (named myFolder) to my project and fill it with
files and want it to appear under "../projectFolder/bin/debug/myFolder"
and "../projectFolder/bin/release/myFolder". I want my program to
access files within "myFolder".

What is the procedure in the IDE to do that? The only location I got
was "../projectFolder/bin/myFolder" doing "add folder" from the project.

Thank you :)
Marty
Dec 6 '05 #1
6 5809
you can get the folder of where the mail executable is runned from with
this: System.Windows.Forms.Application.StartupPath, this will return a
string to the current folder ("../projectFolder/bin/debug/") without
the trailing '/', so remember to append it befor adding new
folders/files to it ;)

Dec 6 '05 #2
Hi Viri,
thank you, I already use the "StartupPath", very usefull. I think my
request lack of a specific detail, I'll tell you. I save my project in
a sourceSafe database, and I want that anybody who open the project from
the VSS DB get immediately the set of folder and file (\myfolder\*.*) to
its local project directory under "bin\debug" or "bin\release".

So I thaught that I should create the folder "myFolder" from the project
in the solution explorer.

Am I right? I hope I am more clear :)

Thank you!
Marty

ViRi wrote:
you can get the folder of where the mail executable is runned from with
this: System.Windows.Forms.Application.StartupPath, this will return a
string to the current folder ("../projectFolder/bin/debug/") without
the trailing '/', so remember to append it befor adding new
folders/files to it ;)

Dec 6 '05 #3
Marty,

I understand you want to do this in the IDE e.g. upon running project from
the IDE (F5 or Ctrl+F5 ) myFolder to be created in the correct output
folder.

What I'd do in this case is I'm going to create myFolder in the project
folder (along with the rest of the source files) then I'm going to add a
post-build event that is going to be like

md "$(TargetDir)myFolder"
copy"$(ProjectDir)*.*"$(TargetDir)myFolder"

VS creates *bat* file out of the code for the build events so you can use
any command prompt command there.

To add post-build event in VS2003 for C# open the project propeties and find
"Build Events" settings under the "Common Properties" sections.

I hope that you use C# because in VS2003 VB don't support build events. As a
matter if fact if you add the post-build event directly in the vb project
file it will execute it, but next time you do something on the project
settings in the IDE the build event will be removed.

In VS2005 both VB and C# support build events.
--
HTH
Stoitcho Goutsev (100) [C# MVP]

"Marty" <xm******@hotmail.com> wrote in message
news:l9llf.234949$ir4.204910@edtnps90...
Hi,

I want to add a folder (named myFolder) to my project and fill it with
files and want it to appear under "../projectFolder/bin/debug/myFolder"
and "../projectFolder/bin/release/myFolder". I want my program to access
files within "myFolder".

What is the procedure in the IDE to do that? The only location I got was
"../projectFolder/bin/myFolder" doing "add folder" from the project.

Thank you :)
Marty

Dec 6 '05 #4
Hi Stoitcho,

That sound very interesting, I'll try it.

Does the post-build event content is handled when we make a deployment
project? Does all myFolder content will be treated looking like
dependencies?

Thank you very much!
Marty

Stoitcho Goutsev (100) [C# MVP] wrote:
Marty,

I understand you want to do this in the IDE e.g. upon running project from
the IDE (F5 or Ctrl+F5 ) myFolder to be created in the correct output
folder.

What I'd do in this case is I'm going to create myFolder in the project
folder (along with the rest of the source files) then I'm going to add a
post-build event that is going to be like

md "$(TargetDir)myFolder"
copy"$(ProjectDir)*.*"$(TargetDir)myFolder"

VS creates *bat* file out of the code for the build events so you can use
any command prompt command there.

To add post-build event in VS2003 for C# open the project propeties and find
"Build Events" settings under the "Common Properties" sections.

I hope that you use C# because in VS2003 VB don't support build events. As a
matter if fact if you add the post-build event directly in the vb project
file it will execute it, but next time you do something on the project
settings in the IDE the build event will be removed.

In VS2005 both VB and C# support build events.

Dec 6 '05 #5
Marty,

There are two build events - pre-build and post-build they are executed
before executing build and after executing the build operation. For the
postbuild there are couple of conditions - every time or only on succesful
build. It is simple execution of a *bat* file the files are not treated as
dependencies. If you want to more special processing during deployment you
should consider creating installation package.
--

Stoitcho Goutsev (100) [C# MVP]

"Marty" <xm******@hotmail.com> wrote in message
news:i7mlf.234960$ir4.120328@edtnps90...
Hi Stoitcho,

That sound very interesting, I'll try it.

Does the post-build event content is handled when we make a deployment
project? Does all myFolder content will be treated looking like
dependencies?

Thank you very much!
Marty

Stoitcho Goutsev (100) [C# MVP] wrote:
Marty,

I understand you want to do this in the IDE e.g. upon running project
from the IDE (F5 or Ctrl+F5 ) myFolder to be created in the correct
output folder.

What I'd do in this case is I'm going to create myFolder in the project
folder (along with the rest of the source files) then I'm going to add a
post-build event that is going to be like

md "$(TargetDir)myFolder"
copy"$(ProjectDir)*.*"$(TargetDir)myFolder"

VS creates *bat* file out of the code for the build events so you can use
any command prompt command there.

To add post-build event in VS2003 for C# open the project propeties and
find "Build Events" settings under the "Common Properties" sections.

I hope that you use C# because in VS2003 VB don't support build events.
As a matter if fact if you add the post-build event directly in the vb
project file it will execute it, but next time you do something on the
project settings in the IDE the build event will be removed.

In VS2005 both VB and C# support build events.


Dec 7 '05 #6
Hi Stoitcho,

thank you for your detailed explanation, now I understand the mecanism :)
Marty

Stoitcho Goutsev (100) [C# MVP] wrote:
Marty,

There are two build events - pre-build and post-build they are executed
before executing build and after executing the build operation. For the
postbuild there are couple of conditions - every time or only on succesful
build. It is simple execution of a *bat* file the files are not treated as
dependencies. If you want to more special processing during deployment you
should consider creating installation package.

Dec 7 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: David Webb | last post by:
The problem started when the Working Folder for a project was somehow set to the folder of another project. I set the correct working folder in VSS and deleted the .vbproj files that had been...
6
by: Vagif Abilov | last post by:
We decided to adopt .NET coding guidelines posted by Brad Abrams from Microsoft: http://blogs.msdn.com/brada/archive/2005/01/26/361369.aspx Here is what Brad (and AFAIK Microsoft) suggests...
5
by: Stan | last post by:
When I create a Web project and then try to add the files to it (Add Existing Item), I get this error message "The folder http://localhost/FinWeb is no longer availabe" In fact the folder and...
4
by: Brad | last post by:
I'm not one to rant or flame....so please excuse me while I do so for this once. I've now spent a bit of time working with VS2005 beta 2 to see how it functions for web development, especially how...
5
by: astroboy | last post by:
How do I get project folder in .NET?
8
by: vinesh | last post by:
I have sample Asp.Net Web Application project. Let me know how to keep the files related to this project (like the webform.aspx, WebForm1.aspx.vb, WebForm1.aspx.resx) in a separate folder within a...
4
by: TS | last post by:
in my web project's bin folder, the dll, that comes from a project reference of a class library in same solution, can't be deleted. it says it has a sharing violation. i also cannot delete the...
2
by: cashdeskmac | last post by:
Why is it that when I create a new web application, the project folder containing the webform, web.config and csproj files appears in C:\inetpub\wwwroot, yet my .sln and .suo files appear in...
5
by: clintonb | last post by:
I'm a newbie when it comes to asp.net. All my prior experience is in making Windows applications in C++. In the past when I made windows applications, the project or target file would keep...
1
by: ianoble | last post by:
Hi all, I am running a simple command line Get for a networked VSS database. The command executes properly until it reaches a directory that is corrupted. Because the database is not local, I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.