Visual studio copy folders to remote machine not working - remote-debugging

Is there a way to copy a whole folder with all the files it has from local machine to remote machine selected path?
In visual studio under project properties, I have Copy Sources and Build Events->Pre-Build Event, which help me to copy files from my local machine to the remote, but those options do not allow me to copy a folders over, only a files.
Since I have a big amount of files it seems weird to specify every file that I wish to copy to remote instead of specifying the folder.
I am using Visual Studio 2019

Related

How to change the working directory in visual studio for c++

Usually, I place all the assets I need in the project folder, and whenever I run it using the Visual Studio debugger, it runs fine. But when I run the .exe file using the command line, or by just clicking on it, it has problems loading the files. The only way it can load the files is if copy all the resource files in the folder that my .exe application resides in. How could change where Visual Studio looks for the resource files when I run it using the Visual Studio Debugger so that it looks in the folder with the .exe in it, and not the project folder for all configurations (i.e. Debug and Release).
If I understand correctly you would like to move application dependencies into the Debug or Release folder.
You can do it using project property page (right click on the project and select properties). From list on the left side, select build events. There are three options, you can use Post-Build.
Have a look here : Visual Studio Post Build Event - Copy to Relative Directory Location

Copy folder to build directory Visual Studio C++

How do I go about to make Visual Studio add a folder from my project into the build directory (for example \x64\Release)? I have a folder for images that I want to be included when I build my application so that they can easily be accessed in relation to the executable's location. The problem with doing it manually is that I have to copy it over manually for both my debug and release folders instead of keeping it all compact withing my project. It also helps with uploading to github.
So is there any way to do this? And if so, how?

How to save default startup project in visual studio

What information does visual studio look at when determining the start-up project?
I have a C++ visual studio solution with 2 projects. My source control is messed up so I have to copy my solution folder from the repository to my local disk. When I do this and I run my application, the wrong project is set as the start-up project. In the repository I check in the .sln and .vcproj file as well as the cpp/h files, but not the .suo or .user files.
Visual Studio: Where does it store "Set as startup project"?
The startup project is stored in the .suo. As mentioned in that SO post, you should not check these in, because they are not portable across machines/directories.

visual studio 2013 modify path variable when running .exe

I have compiled an exe file in Visual Studio 2013, and it depends on some external files to function. I want to keep those files in the same folder that the exe is in. When I run the .exe by clicking on it in file explorer, it loads the files fine. However, when I run it from Visual Studio, it is unable to run because the PATH variable does not include the directory with the necessary files. How can I configure my project to run the program with a modified path variable so that it can access the files properly?
As far as I understand you question correctly. I suspect that this is an issue related to the different directories when you execute. In Visual Studio (to my knowledge), you have a folder named Debug and a second folder named Release.
You may choose in Visual Studio to run the program in either debug or release mode. But you might not have the required files neccessary in both directories.
For example:
I've made a program that reads "Hello World!" from hello.txt, and displays this in the dialog window as a string.
If I store the file in the Release directory, the executable will run fine outside the IDE, when just launching the executable file.
However, if you run the application in debug mode through the IDE (Visual Studio), the program will not find the neccessary file. The program is looking for the file in it's current directory (Debug).
A quick fix to this is to copy the required files to the current working directory. Eventually have a duplicate set of files in both directories at all times.
Hope that I did understand you correct, and that my answer helps you. :)

How to access resources when running app in Visual Studio?

in my application, I use various resources. I specified pre-build events to copy my resources to output directory. My directory structure looks like this:
/Debug/Models/
/Debug/Shaders/
/Debug/Textures/
/Debug/sfero.exe
/Debug/...
I want to access these resources relative to the .exe file and that works fine when I run the executable directly from Debug folder, but when I run it in Visual Studio, it is being launched in different directory, thus I cannot access my resources. Obviously, I don't want to copy my resources to location from where Visual Studio runs my application.
Any suggestions?
Thanks
You can either make your application logic smarter about searching for resources, or you can pass command-line parameters (see the Debugging area of Project Properties) when launching from Visual Studio, passing the path where to look.
The default current directory in Visual Studio is defined as $(ProjectDir) - which is by default the location of your vcproj file.
Go to your project's Properties -> Configuration Properties -> Debugging -> Working Directory and change it to $(SolutionDir)$(Configuration)\ or whatever your Output Directory points to.