I am having some issues with VS C# 2010. Upon create a project I can not seem to locate the project files after saving.
On my laptop they store to C:\Users\james\Documents\Visual Studio 2010\Projects but on my desktop they are being stored in C:\Users\james\AppData\Local\Temporary Projects\mediaplayer
I can seem to locate this folder, even when using the variable %appData%. There is no Local, or Tempory Projects folder. At least I can't see them.
I much preferred the project being stored in Documents. Is it possible to change this? If not, how can I physically access the folder with my project within it?
You can change default folder for new projects in Visual Studio settings.
Click Tools menu
Click Options
Find "Projects and Solutions"
Choose "Project location"
AppData folder is hidden. You have to type its address in address bar manually or you can enable view for hidden files in Windows Explorer.
For Visual Studio 2019 & 2017 :
Click Tools menu
Click Options
Find Projects and Solutions
Choose Locations
and edit the projects location box (the first one)
When you first fully save everything (or exit and choose to save) the project files will be saved in the expected location. It's only in a temporary location until you explicitly save.
C:Windows\Users\"username"\source\repos
this the location of all your projects.
thank you
Projects are stored in Temporary Projects under some settings only if you never save them. If you save the project (File → Save All) then you can choose where to save it. The default is the Projects folder inside your Documents.
Right-click on the tab name of any file you have open and select 'open containing folder' to get there quickly.
Just thought I'd add this as was annoyed at not seeing the file path names when a file just opens via VS by default. (eg, windows terminal app settings menu)
By default Visual Basic 2010 (Or Visual Studio) doesn't notice you when a project is backed up. You can manually check it
Project Backup Location:
You can find the project backed up in C:\Users\<User Name>\Documents\Visual Studio 2010\Backup Files hope that helps.
For you case:
Location to backup project should be C:\Users\james\Documents\Visual Studio 2010\Backup Files\mediaplayer
Related
I have Visual Studio 2017 project in which I need to open a folder named Devdog.General, which is also included in my Solution. However, it won't recognize it as an existing folder and gives me a missing directory / namespace error when I try to import it. See screenshot for more info.
Try this button:
I had a similar problem the other day and it had to do with files that Visual Studio didn't know were part of the project because they'd been created externally (and that included folders). Visual Studio could see them but it was hiding them from me.
After clicking that button, you will be able to right click on the folder and select "include in project" which will include the files for compilation and navigation.
First, try selecting any of your "*.cs" files inside this "General" folder and check in the "Properties" view if the Build Action is configured to Compile. Visual Studio will only compile your file if it has the correct build action.
Secondly, open that "*.cs" file and verify if the namespace defined inside it is correct. For C#, folder structures don't matter much: what really matters is the namespace you have defined your classes in. You can define your classes in namespaces completely different than the folder they are included in your project. That is completely arbitrary, and up to your organizational needs.
An image illustrating what you need to check (and where) follows.
Things to Check
1.) Check the namespaces inside .CS files - they collectively create usable namespaces you are referencing - not folder names. If you create a few files, then move them to a folder, and create newer files inside that folder they will have different namespaces. The newer files will have the default Namespace value followed by .FolderName. So be sure to check that out.
2.) CSPROJs can get hosed and lose reference to folders that display in the UI. Remove the folder from the project (through the VS2017 UI, right click and choose that option). DO NOT DELETE. Then recreate the folder in the UI (it shouldn't let you, navigate to the folder directory manually and rename the folder.OLD temporarily). Once the folder is rename, try recreating the folder. Upon success move all your CS files into the new folder from folder.OLD. After files and folders are back to where they were essentially, then in Visual Studio, "Add existing items" on your .cs files. This recreates the CSPROJ references one by one.
3.) Unload CSPROJ, right click and Edit CSPROJ to manually check all the .CS references in ItemGroups. Make sure its myfolder\myotherfolder\mycsfile.cs.
4.) Remove reference to other projects that contain namespace, and re-add them. Verifying, one by one, the namespaces begin reappearing in Intellisense as recognized.
5.) If you try the above step, close Solution, close Visual Studio, navigate to SLN folder container, and delete hidden folder .vs and then reopen everything.
What happens is sometime a folder rename or file transfer doesn't propagate to the .CSPROJ folder, a namespace then doesn't get intellisense cached, and errors galore show up.
Please check your folder name and namespace name. probably folder name and namespace did not match
enter image description here
I think this is a known problem with real folders and solution folders in visual studio. I'm facing now the same issue. I got a project handedover from other developer and he already created, directly under the solution some folders and sub folders. All these directories and sub directories are appearing in visual studio solution explorer and also on the file system. As I mentioned, I'm using VS 2015. Here a screenshot:
I have no idea how he did this or if he used any tool for that.
When I try to create a sub folder under SQL-Scripte folder and add some files to it, then the added files are appearing directly under the solution directory. See this screenshot:
Any help is highly appreciated :).
Thanks!
Actually the folders that you create as solution folders, are virtual ones that you cannot see on the file system. To be able to see the folders on both sides (VS and file system), I managed to fix this with the following work around:
1- Create a solution folder (let us name it newSql) under your SQL-Scripte folder
2- Add the files to it.
3- You will notice that the files are located directly under your solution folder in the file system. Exactly as you mentioned in the second screenshot.
4- Now close your visual studio and navigate to your solution directory.
5- Create under the folder SQL-Scripte (on file system), a folder named newSql and copy the files from your solution directory (in your case the SQL file that starts with 1.17....) to this newSql physical system folder.
6- Then open your (.sln) file with Notepad or Notepad++
7- Locate the entry for the new added newSql folder and there change the path to point to your new file system newSql folder. Like this: SQL-Scripte\newSql\1.17.sql
8- Save and again open VS. If you are using TFS then you should right click on the 1.17.sql file and click add to source control and check in.
Like this, you will see the folder on both sides and you can manage it only from VS.
Hope it helps.
I want to make a backup from the whole project. I also need to rename every backup. I'dont like the way to copy the project folder and rename the folder and the project file.
I've already tried to make it like that:
http://jasonfaulkner.com/VisualStudioExpressProjectBuildBackups.aspx
But it doesn't work, I am always getting the error "Invalid parameters"
Does anyone already tried this?
Thanks
The DPack extension for Visual Studio includes the Solution Backup tool that creates a zip archive of the solution and auto names it.
Manually edit .sln file
This method is entirely aimed at renaming the directory for the project, as viewed in Windows Explorer.
This method does not suffer from the problems in the Remove/add project file method below (references disappearing), but it can result in problems if your project is under source control (see notes below). This is why step 2 (backup) is so important.
1- Close Visual Studio.
2- Create a backup of your .sln file (you can always roll back).
3- Imagine you want to rename directory "Project1" to "Project2".
If not using source control, rename the folder from "Project1" to "Project2" using Windows Explorer.
4- If using source control, rename the folder from "Project1" to "Project2" using the functions supplied by source control. This preserves the history of the file. For example, with TortoiseSVN, right click on the file, select TortoiseSVN .. Rename.
5- In the .sln file, edit all instances of "Project1" to be "Project2", using a text editor like NotePad.
6- Restart Visual Studio, and everything will work as before, but with the project in a different directory.
Alse would recommend TFS, a powerfull tool to do what you pretend. You will be able even to recover previous versions of specific files,if you have any error and you have troubles find it you can see what changes you did since last "check in " etc. There are many options
I changed the name of my folder which holds my project. Now when i open the project in Visual Studio, no files open automatically. It is important that i submit this project very professionally. Is there a way that i can make my Form.cs file show automatically in VS when the project is opened, as it does by default if you do not change the project folder name?
You will need to right click on the project in Solution Explorer, go to:
Add -> Existing Item
Then find your Form.cs file
For some reason, my shared folder ,which contains some error pages and my master _layout.cshtml page, is hidden. I can only access it when I click on show all files in my solution explorer. This is not a real problem, everything still works but I know this is not standard.
I don't know how this folder became a hidden folder, but does anyone know how to set the folder visible?
When I browse to my project folder in my file system, the folder is not a hidden folder...
I use Visual studio 2012, os = windows 7 64 bit
Just a wild guess here, but can you right click it (in Visual Studio) and "Include In Project"?
It will not be included in your .csproj file.
To include it, either open your .csproj file in notepad and add in the lines or remove the folder from the project and add it back in.