473,562 Members | 3,113 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5818
you can get the folder of where the mail executable is runned from with
this: System.Windows. Forms.Applicati on.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 "StartupPat h", 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\releas e".

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.Applicati on.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)my Folder"
copy"$(ProjectD ir)*.*"$(Target Dir)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******@hotma il.com> wrote in message
news:l9llf.2349 49$ir4.204910@e dtnps90...
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)my Folder"
copy"$(ProjectD ir)*.*"$(Target Dir)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******@hotma il.com> wrote in message
news:i7mlf.2349 60$ir4.120328@e dtnps90...
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)my Folder"
copy"$(ProjectD ir)*.*"$(Target Dir)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
11024
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 created in the wrong folder on the hard drive. Before I discovered these files, .NET kept trying to create a new project with _1 following the project...
6
3609
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 regarding project folder structure: "Directory names should follow the namespace for the class For example, I would expect to find the public class...
5
2529
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 the virtual directory FinWeb both exist and project compiles just fine, but I cannot add the existing files to it. If I create a project with a...
4
2882
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 our current extensive number of .Net 1.1 web apps convert to it. After a week's time I dont's mind the converted app code that was broken and had...
5
7730
by: astroboy | last post by:
How do I get project folder in .NET?
8
2040
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 project and what all setting will I be required to do So that my original project works. Can I keep WebForm1.aspx in root and code behind file in...
4
1675
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 .projdata file in the class library's obj directory. This is causing updates to the class library not getting seen in the web app. i ran filemon and...
2
2135
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 another folder in My Documents\Visual Studio Projects? Is this normal, or have I somehow made an inadvertant change somewhere?
5
2754
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 track of the dlls that are required by the project. This project file would then be checked into source control. So if another user got the project...
1
3092
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 don't have access to run the analyze utility to try and fix the issue. Plus, I've been told it's been run before and has not resolved anything. To...
0
7652
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7576
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7867
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8095
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7625
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7934
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6219
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5476
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.