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

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.

Related

Cannot navigate to the symbol under the caret - Visual Studio 2015,2017 and 2019

I have been searching for a solution to this for the last 3 days. Please help.
I have tried opening my solution in VS 2015,17 and 19 and whenever I try to go to my namespace I get the error
"cannot navigate to the symbol under the caret"
None of these have helped me.
Failed : VS2019 ASP.NET MVC "Cannot navigate to the symbol under caret"
Failed : https://developercommunity.visualstudio.com/content/problem/505489/cannot-navigate-to-the-symbol-under-the-caret-3.html
I have also deleted my .vs folder, didn't work, someone also said delete your .user folder. But there isn't a .user folder in my project.
I also searched for the dot net compilers and found an update but the update made no difference.
It's only on my visual studio. Other people are not having this issue.
I had a similar problem some time ago, and the solution was to create a solution in visual studio with a new MVC project, and then add the source code files to the new project.
So Installing Resharper fixed my problem after I reloaded the solution in my Visual studio with Resharper installed.
https://www.jetbrains.com/resharper/
I used the trial version.
Note: It took a second to load though so make sure resharper has analyzed your files. You should see a progress bar at the bottom right of your Visual Studio when you restart your Visual Studio and open your solution.
Closed Visual Studio, then deleted ".vs" folder in the solution folder

Where is the cache file located in VS 2015's app directory?

I'm trying to clean and rebuild my solution in an attempt to fix another debugging error but can't locate the for VS 2015 cache file. The solutions in this similar question don't appear to apply to VS 2015 / Windows 10. Does someone know a more accurate file directory address?
It's in the .vs folder in the root of your project.
As it's a hidden folder you need to enable "show hidden folders" in explorer or whatever file viewing tool you use.

Files pulled from Git result excluded from the project

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.

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"

I need to create a project file for an ASP.NET website

I haven't got a solution file for a project that i have been asked to work on. However i have all the other aspx and aspx.cs files in one location on my comp. Is it possible for me to create a solution file or may be create a new website project in visual studio 2008 so i should be able to compile the website in visual studio.
Alternatively if someone can direct me to a link for setting up a website on IIS would be a great help but bare in mind i dont have a .sln or a .csproj file.
Any Help would be much appreciated.
Thanks in Advance,
Nitesh.
You mention that you don't have "a solution file for a project". Check to see if you have a project file. If you do, you can just double click that and it will open that project in Visual Studio and place it in a solution.
Just to clarify. A project contains application files (aspx, aspx.cs, .cs etc), and solutions contain projects.
If you don't have a project file, I would create a new empty web application and then "add existing files" to it.
You can create a new website project in VS and then copy your files into it. Use the Show All Files button on Solution Navigator and add them to the project. Should work.
You'll want to create a new project and then add all of your existing files to it. See How to: Add Existing Items to a Project

Categories

Resources