Adding a folder with files to application - Visual Basic 2010 - vb.net

In my current project I have a folder with several files that the application needs to function properly. The folder is in the bin/debug folder and with the line Application.StartupPath I can easily access the files. It couldn't be easier.
However, when I publish the application the files don't seem to be included in the project, at least not at the StartupPath.
So my question is: how am I supposed to add this folder to my published application?

First, you'll need to include those files in your project. Then click each file in the Solution Explorer and in the Properties Windows change the value for "Copy to Output Directory" to "Copy Always".

Related

How to copy dll config files into bin folder while publish in Visual Studio 2013?

I am working on a web application that use some external dll with config files, such as Lib1.dll, Lib1.dll.config, etc. Basically these files are manually copied into bin folder and only got loaded at run-time.
I tried to add those dll as reference and am able to copy these dll files into bin folder, but how can I deal with those config files? Is there a way I can include these config files in solution and force them copy to bin folder when using Visual Studio publish?
Please help, Thank you.
You can include the files into the project in Visual Studio, and change the file property "copy to output directory" (in "Properties Window") to "always" or "copy if new".

Where can I find the rootfolder for my VB.net project

I am making a project that will be put on a disc to use. This means that all of the files that I call upon have to be on that disc. How and where do I put my files to ensure that they will stay with the project? Does it go in the bin folder? And when I am calling on that file what file path do I use?
In general, the bin folder is not a place you should be storing anything that you want to persist with the project.
When you build, Visual Studio will copy the files needed to run the program into the bin folder, such as libraries and web.config or app.config files.
For other files you want included, add them to your project and set their build action property to Content:
Content - The file is not compiled, but is included in the Content output group.
For example, this setting is the default value for an .htm or other
kind of Web file.

Set root directory for project in Visual Studio 2012 Solution Explorer

Visual Studio 2012's Solution Explorer can be configured to display the actual files on disk (rather than just project files) simply by toggling the Show All Files button. Each project will display the files and folders located in the same folder as the project file itself.
Is there any way to change the root directory of what is displayed?
My cross-platform project is organized like this:
project/ide/vs2012/project.sln
project/ide/vs2012/project.vcxproj
project/src/*
I want Solution Explorer to show the files in my src directory, not my vs2012 directory.
I created a symbolic link under the vs2012 directory to point at my source code:
MKLINK /D src ..\src
Now Visual Studio sees the src folder underneath the project.
I think, if I understand correctly, you should open up the .sln file at the project's root in a notepad application and you'll find what you're looking for in there.

How do I publish specific files not in project in VS 2010?

Is there a way I can publish *.ascx files without adding them to my project?
I am trying to make my user controls in Visual Studio 2010 reusable. I have a project containing my user controls called ControlsLibrary solution directory. I copy the ascx files to the web directory upon building the project with build events.
I use the command copy "$(SolutionDir)ControlLibrary\*.ascx" "$(ProjectDir)controls\"
This copies the *.ascx files from G:/SolutionDirectory/ControlsLibrary to C:/Inetpub/wwwroot/WebProject/controls
Now when I publish WebProject, the publish does not copy the *.ascx files from C:/Inetpub/wwwroot/WebProject/controls to my website. This is because they are not added to my project.
Is there a way I can publish *.ascx files without adding them to my project?
I know there is a way to publish all files by selecting the option "All files in this project." That includes more files than I want.
Have you considered using the Virtual Path Provider approach? Here's a good article on it: Load Web Forms and User Controls from Embedded Resources.

Move files to a specific folder when run the setup file for VB.Net Application

I have created deployment package for VB.Net appolication and it runs fine. When setup is rnning, I want deployment package to move a file from bin folder to other specific folder.
Please suggest, how can I move this file to specific folder.
Any help would be appreciated.
Thanks, Yogi
In Visual Studio 2008 setup project,
Select File System on Target Machine and then from Action menu select Add Special folder and then Custom folder. A new folder will apear on left hand side under the "File System on Traget Machine". Add files, into this custom folder, which you want to copy into into specified location,
Now go into the property of this custom folder and set the DefaultLocation where you want to copy files under this custom folder.
Now when you run the setup this file under the custom folder will copy into the specified location which you set in DefaultLocation.
Yogi..