add existing code directories to Visual C# 2010 express - c#

New to Visual C#. I can add existing .cs files but is there a way to add entire code directories to C#. Otherwise I would have to create folders again within visual C# and add files into it. There has to be an easier way to replicate my existing directory structure in visual C#.

Click Show All Files in Solution Explorer to see the entire filesystem within your project directory.
You can then right-click an entire folder (or select multiple folders) and click Include in Project.

You should be able to simply drag/drop folders from an explorer window into your solution by dropping them on the project or a sub-folder.

Related

Build Visual Studio package (template) structure manually

I am trying to create an application for File management system.
This is how project structure should look like:
I have managed to download needed files from GitHub:
Is there any guide how to add them all to Visual Studio Project to get it working?
There is VaultApplication.cs in src folder.
Move the files to your project's folder, then, right-click on the project node (MyCompany.MyProduct.MyVaultApplication1). Select Add>Existing Items. And then add the files and folders you just moved.
Edit: as pointed out in the comments, moving the files to your project's folder isn't 100% necessary, but I think it makes things easier to manage.

Folders created in visual studio solution under solution explorer not appearing in source control explorer

I converted my MVC solution to layered architecture .
For this I added folders in my solution in Solution Explorer. Everything is working good, my colleagues are able to take the latest of solution and the folders are appearing in solution explorer.
The issue is I am not able to see the folder structure in TFS(in
Source Control Explorer.)
Probably I should have create the folder structure in TFS directly.But now I have lot of changes checked in since I created the folder, so I think this option will not work.
Please Advice.
It's supposed to be it. The root cause is Visual Studio solutions Folder are not real Folders.
Solution Folders only seem to be "virtual folders", because they are
not really created in the Filesystem and files inside solution folders
are just sitting in the same folder as the .sln file.
You can create real folders in a "project" within the solution, but not in the solution itself. Details about this area, you could refer below questions:
Visual Studio Solutions Folder as real Folders
What is a solution folder in visual studio
Source Control Explorer is used to manage files in TFVC, the files in the solution folder will shown up in the source control explorer and be the same level with .sln file, however the solution folders itself will not appearing in source control explorer and keep the folder structure.
At least for C# solutions in Visual Studio 2019 you can manage individual forders in the solution.
To do this the view has to be switched to Folder View using the Switch View button in Solution Explorer.
Look here for detailed description

Can't create folder inside Shared project in Visual Studio 2017

Can't create folder inside Shared project in Visual Studio 2017. On place context menu I see only "New Filter"
Is it in general possible - create folder in this type project ?
Update 1: - I mean create folder not in Folder view...
Maybe you just need to enable Show all files item in Solution Explorer toolbar?
Filters are logical groupings of files, that aren't reflected in the filesystem. Creating filters is the only option available when looking at the solution view. If you want to add a filesystem folder instead you have to toggle between solution and folder view of the Solution Explorer:
Once in folder view, you can create a filesystem folder:
In general "enable Show all files item in Solution Explorer toolbar" is good desigion, but if you reopen vs2017 you need everytime enable it. So best desigion - change your settings in Tools- Options.. - VC++ Project Settings - Solution Explorer Mode - to the Show all files

Can't "save as" or copy a C# project

I want to copy a C# project so I can make some changes to it while keeping the old one.
When I copy its whole folder, the solution file does not open on Visual Studio 2008. Visual Studio starts and it does not open anything.
There is no "built-in" tool for this.
In Solution Explorer, Right-Click your solution and select "Open Folder in Windows Explorer":
In Windows Explorer, select one folder up:
Right-Click your Project's folder, then Copy it to the Clipboard:
Now, simply Paste your Clipboard contents in the same directory or in another directory.
NOTE: If your project uses relative path names and you paste your project into a different directory, you will need to go in and fix any broken link references.
If you are opening the solution file, you will need to open the solution explorer pane in Visual Studio and then select the project/file you want to open.
Do you right click the folder, select copy, and then paste the copy? You can copy the whole folder and simply rename the folder to something else. There shouldn't be any problems with that. I have done this many times and always was able to open the copy.
Visual Studio 2013 Express is free and out right now. Try it if everything else fails.

For a Silverlight 4 Visual Studio solution, what needs to be in version control?

I have a Silverlight 4 app that I'm building with Visual Studio 2010. I'm using Mercurial/TortoiseHG to do version control. Which files do I need to check in? By default, it checks in all sorts of .dlls in /bin/debug and stuff. Do I really need those? Or can I just grab code and content files? Do I need to version something to keep track of project properties and references, or is that contained within the .csproj file itself?
You don't need to include stuff in /bin or /obj. This is true of all VS solutions in source control. These are recreated upon every rebuild. Also, for Silverlight specifically, you don't need to check in the XAP file that is generated in the ClientBin of your web app.
From MSDN (via this social.msdn thread):
You can add the following files to Visual Studio source control:
Solution files (*.sln).
Project files, for example, *.csproj, *.vbproj files.
Application configuration files, based on XML, used to control run-time behavior of a Visual Studio project.
Files that you cannot add to source control include the following:
Solution user option files (*.suo).
Project user option files, for example, *.csproj.user, *.vbproj.user files.
Web information files, for example, *.csproj.webinfo, *.vbproj.webinfo, that control the virtual root location of a Web project.
Build output files, for example, *.dll and *.exe files.
It doesn't say anything specific about Silverlight projects though.
Is Mercurial/TortoiseHG integrated into Visual Studio? i.e. can you check out/submit from within VS?
If so, if you right click on the project name and select "Add Solution to Source Control" it should add those parts of the project that it needs ignoring everything else.

Categories