Files pulled from Git result excluded from the project - c#

I need your help with Visual Studio and Git. I and a friend of mine are working on a simple project written in c#. We share the project with git (the code is on GitHub) but there's something wrong: when I pull his new files (or he pulls mine) the files result excluded from the project. I can see them in the project folder, but not in the Visual Studio Solution Explorer. To see them I have to click on the "Show All Files" at the top of the solution explorer and then they appear, but, as I said, they result excluded (with the dotted border). See the image here below:
This is strange. We have always worked with Git on other platforms (Android Studio, Eclipse, xCode) and this is the first time we encounter this problem. How can we solve it? Thank you in advance,

Sometime you have to add the files manually. Click on the folder in VS and "Add existing item" if your missing files are on the disk.

Equivalently, if some of the source files do not show in the Solution Explorer but do in fact exist in the project folder you can simply drag those files into the Solution Explorer. Following worked for me with VS 2015.
Right click on the project and click on "Open Folder in File Explorer"
Drag the missing file from the File Explorer to the Solution Explorer and drop in the place you want it to be and save solution.
Now it should appear in the project Solution Explorer.

Related

Missing folder and files from visual studio. not even showing in Project

I am missing two folders and number of files in the visual studio 2019 from my project. All these files are showing in the local commit. I tried to recover it and also tried to push to GitHub but got some errors. Is there any way to recover folders and files?
Can someone help please
Thankyou
If you right click on your Project, goto Add -> Existing Item... and select the missing Folders/Files from the explorer select window.

Problems with renaming .cs properties in the solution explorer

I am having trouble renaming my file from T1_Khan_Saad to P1_Khan_Saad. There is no option to rename when I right click in the solution explorer.
According to the file icon in your screenshot, this is a linked file (note the little arrow at the lower right-hand corner). Visual Studio cannot directly rename linked files (which makes sense - they might be referenced by other projects as well).
What you can do is:
Remove the file from your project.
Rename it at its physical location using Windows explorer.
Re-link it to your project.
There's a uservoice entry for enabling this feature in Visual Studio:
Allow renamed linked files in solution explorer

I can't see the folders I created in my project

I have been working on a project in C# in Microsoft Visual Studio 2012. Since I have a lot of C# files I decided to put them in a few folders based on their type. For example an interfaces folder and an enumerations folder.
Now when I open my project I can't see any of my folders and all of my C# files are not in folders. I can't open the files because it says that the directory has changed or has been deleted. I am adding a photo so you will be able to see what happened to me.
You should've created the folders and moved the files inside the VS Solution explorer, then everything is tracked automatically.
The easiest way to fix this is to enable "Show all files" at the top of the solution explorer, refresh the view to make sure you can see everything
Then right-click the slightly grayed out folders and choose "Include in project"
Once that's done, delete the "Broken" old files.
Follow the steps to add the files back to the solution
From the Project menu toggle on "Show All Files"
Now you should see the files/folders in Solution Explorer.
Select those you want to include
right click and choose "Include in Project"
after include all files delete the broken file links
Sometimes you have to click "Refresh" in the solution explorer first. Then you will be able to see hidden files, when clicking "Show all files" and you will be able to "include them in project".
sometimes Visual Studio file tree lacks your latest update to solution explorer
so, the solution is to just right click on your solution and select "Sync Namespaces"

Copying two external folders to installation path with the setup project

I have two folders which are totally external to the solution . Consider them as some external text files i the folders, that I need to copy to setup installation path when the software is installed through setup.
However, I have only found option to add Application folders inside the solutiion (and their content files). How do I add external folders and their content in this setup project, so that it gets copied to the installation path?
If you are talking about Visual Studio Installer Setup project its pretty simple...
Right Click on the Project in Solution Explorer and open View -> File System
Select Application Folder from the left side tree, right click and say Add -> Folder
On Visual Studio 2015, simply drag and drop folders on File System view...

"Include in Project" option missing from folder context menu in VS2010

I'm running VS2010 Pro SP1 (10.0.40219.1). I copied/pasted a folder into my solution's directory in Windows Explorer, clicked the ghost button in VS' Solution Explorer so I can now see the folder from VS, right clicked on the folder, and the "Include in Project" context menu item is missing.
I can manually include all of the files within the directory tree, but that's a task considering this function once existed within my installation of Visual Studio.
This solution is an MVC3 Web App, but it appears to be happening with all solutions, Console Apps, etc.
Thanks in advance,
Ben
The menu selection should be on the top-level Project menu.
If you don't have too many customizations, you could also try resetting all settings from the Tools -> Import and Export Settings... dialog.
This works from within a project, but not from the solution level. You can add folders at the solution level, but solution level folders don't map to filesystem folders.
It would work if you had a project in the same folder. But you would be "including" the folder in the project, not the solution.
To add files from that folder, use Add > Existing Item. But the files you add this way will go to your Solution Items folder, which probably isn't what you wanted to do. The Solution Items folder simply maps to the actual solution folder.

Categories

Resources