What files from Visual Studio 2017 Project/Solution should be in a SVN ignore? - visual-studio-2017

I'm working on a solution (C#) with 3 projects in it (one library and two applications) and I wonder what is the bare minimum of files you need to commit to be able to pull off a fresh solution and get it to work right away?
Obviously all source files, *.sln, *.csproj are needed and not the obj folder or bin folder (unless I want to keep a working copy of the compiled files).
But do I need to commit the:
Properties folder
.vs folder
*.resx
*.config
I have Googled it but all I found was a list of the file types, but no explanation of what files where critical to make the solution/project load and compile.
[EDIT]
It has been suggested that this is the same question as: Should I add the Visual Studio 2015 .vs folder to source control?
The question is not related to only the .vs folder, but to all project/solution files.

Though SVN and Git are different Version Control System, I think the files that should be excluded in the Version Control System should be similar. This file is a ignore file for Git (an .gitignore), but should be work as it should in SVN Version Control Systems.
https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
This file is often used in various places like Github Destktop, or the Github Site itself.

Related

How does Visual Studio and Github work together?

For example: I'm making an SFML game and I want to store my project on GitHub so my team members can have access to it. Since its made in Visual Studio does that mean I need to include: Solution file and .vcxproj file?
Also, I've seen projects on GitHub have a "src" folder to organize their repository, since mine was created in Visual Studio does that mean I need to rename my folder that is named after my project to "src" and reupload it? Or are people doing some sort of organization trick I'm missing?
Since the game is SFML, all my binaries (.dll) files are just thrown into my main folder of the project, I'd much prefer to throw them all into their respective folder, but if someone downloads my project does that mean they need to pull it out of that folder and throw it into the project file? (That way visual studio can find them)
TLDR: I'm having trouble organizing my GitHub repo with a Visual Studio C++ Project.
Since its made in Visual Studio does that mean I need to include:
Solution file and .vcxproj file?
Yes, you'll need to include solution and project files. You can see which files you can ignore at gitignore.io. Or, you can use cmake.
I'd much prefer to throw them all into their respective folder, but if
someone downloads my project does that mean they need to pull it out
of that folder and throw it into the project file?
Yes, each collaborator will have to download libraries and make it available to project on their end. And if you have lots of libraries and libraries depending on other libraries, updating them can be painful.
I use cmake and vcpkg. It isn't as straight forward as keeping libraries in project folder but requires reasonable effort for keeping project organized and clean. I'll recommend this approach.

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?

Visual Studio 2010 Creating Packages/Folders in project

I am new to Visual Studio 2010 C++, I am trying to create packages in my project like we do in Java Eclipse but to my surprise the only option I found available was Creating a Folder so I selected that and created several folders added my classes to them then I tried including my header files in the folders I had created but it keeps giving me an error to hat I cannot locate the file, I checked in the Project directory and the folders are not in there but very visible and editable from Visual studio, I tried manually adding a folder with my classes from windows explore and still could not locate them in VC
The logic is organized slightly different than in Eclipse.
With Visual Studio, you create a solution (one directory) in which you will create one or more projects (either in the solution's directory, or in one or several subdirectories. I you have in your components a shared library for example, you would put in a separate project.
The source files in each project are organized in the same directory. If you use folders in a project, these are virtual and not materialized in the OS directories.
Remark: If you really want to organise project files within "hard" subdirectories, you can always force the directory in the item creation dialog. This is particularly practical if you add to a visual studio projects existing items stored according to a more complex OS structure. Unfortunately such a directory structure is not at all displayed in the solution explorer, so it is somewhat confusing.

git and visual studio 2010 express

I have used visual studio 2010 express for a while and have played with some extensive projects for quite some time. Since i'm nearing 50-60 files and thousands of lines of code, i've decided to do some source control for everything so that the project is more easily updated and accessible between all my devices, while also being back up.
I have used git before and am comfortable with it, but now when i made the commit and pushed it to a remote repository on bitbucket.org, i found that the .vcxproj files, while still retaining their correct file structure, also retained the include and lib directories for the device it was pushed from, meaning that when pulled down to another computer, those include/lib directories would be looking in the wrong directories, meaning i have to revise all of them every time i pull/push.
My question, Is there anyway i can push files to the repository such that the solution keeps the folder setup, but not the include and lib directory settings?
Edit:
After some research, i went looking into these so called property sheets in visual studio which are files that can be added to your project. The settings you set their take precedence over the settings of the project, but then the snag there is, if you add the individual property file to the project and then push the the .sln file, and the various .vcxproj files without that .props file, and then someone else clones from the repository, it won't open because it apparently requires that props file.
What i would like along these lines is a default .props file in the remote repository that, when cloned over, is no longer tracked, and then that user can just edit it for themselves. I don't know enough about git thought to make this happen. Does anybody have an idea?
I'm not sure what your problem is exactly, but here's my understanding:
Your project files contain absolute paths (e.g. "C:\myproj\include"). Replace these with relative paths (e.g. ".\include"). The "$(SolutionDir)" variable helps: if your solution file is C:\myproj\myproj.sln, then "$(SolutionDir)include" is the same as "C:\myproj\include". You can change the include and library directories in Project Properties > Configuration Properties > C/C++ and Linker, respectively.
Your project requires third party libaries - such as boost - and these are outside your project, say C:\boost. Unfortunately Windows/VS doesn't have a standard location for third party libraries, so you can either:
Include the library in your project. This is perfectly fine for small libraries, but it's not something you'd want to do with something like boost, which is both big and tends to be used widely.
Mandate that all devices set up these libraries in the same location, e.g. C:\sdk
Use an environment variable, like $(SDK_DIR) in the project, and all devices must set this environment variable.
Let me know if this helps.
What you're after are git's smudge and clean filters. You'll have to write a script for the cleaning, but sed'll probably do the job just fine, you won't need real xml parsing.

Creating a good directory structure

This might be a silly question but I am still learning. I have read several books on creating application and creating a good directory structure. When people talk about creating a directory structure, do they mean the folders you make within the solution explorer (folders you actually find inside of a .sln file) or do they mean setting up and creating folders that reside in the same folder as your .sln file or your compiled application (.exe). I figured the solution explorer folders are different from a typical windows folder cause the folders I create inside my .sln file are no where to be found on my windows system.
Visual Studio has a strange way of dealing with "folders" in solutions. A "Solution Folder" is not actually a physical folder, but more of a virtual folder managed by Visual Studio. Your files may end up in the root directoy, but VS will treat them as if they are in a "folder." This is configured and managed in the VS .sln or project file.
I'm not a fan of how this works in Visual Studio, I don't get why they don't just put files in physical folders. It's up to you whether you want to fight VS and try to keep your files in physical folders, or if you want to just let VS manage it, but ultimately, it really doesn't matter.
a typical directory struction will be like
bin (binaries)
Src
->.sln
->common
->.prj
->Project1
->.prj
->Project2
->.prj
Lib (3rd party lib's)
Doc (documentation)
Tools (3rd party tools)
Setup (setup projects)
Test (test cases)
With C++ in Visual Studio your solution directories need not match the filesystem, but they can.
Typically people refer to the directory structure as the filesystem layout of the project.
It's typical to have visual studio directories called headers and source, you wouldn't lay your project out like this on your filesystem though.
Visual Studio directories aren't just virtual folders though, they can contain filter rules so when you add a file to your project it will automatically get added to the correct filtered folder. They can also specify whether the folder should be under version control or not. And whether they should be parsed for auto complete or not.
Typically on filesystem I will create 1 folder per project and rarely create subfolders inside an individual project. But in the solution explorer I will create top level folders which I put projects into (For example: "Server Components" and "Client Components"), as well as in project folders to group things logically together (For example: Config, GUI, Controllers, ...) so I can find what i'm looking for faster.