why is it whenever I open my solution file it always creates a new subfolder? - visual-studio-2010

I am using visual sourcesafe 8.0 and there is a weird behavior that is extremely puzzling to me. We have this brand new project, the first time I got it from vss, everything was fine. But after I reset the working directory and got the source code, whenever I open the project by double-clicking the sln file, it always creates a subfolder under the current folder, and pull the source code from vss again. Furthermore, if I double-click the sln file under the subfolder, it will create another subfolder under that subfolder and pull the source code again. I think it must be a mapping issue or the sln file is not correct. Anyone know how to fix it? BTW, my project is a web site project (with a solution file)

You can go to Visual Studio menu File->Source Control->Change Source Control and check/update the mapping there.

Related

Visual Studio not showing all Projects in solution

I'm not sure why, but Visual Studio is not showing all the projects in my solution. I need them to show so I can set as default project under solution explorer. I'm not seeing a fix for this issue in a general internet search. The closest I see is VS not showing files folders, but this is different than my issue. Hopefully there is an easy way to fix it, without adding things again piecemeal. My co-workers can see their complete set of projects in solution explorer so it must be a corruption in my workspace.
Open your ".sln" project file using Notepad.
In this file you can observe listed projects like below
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "test.myProject.Data", "test.myProject.Data\test.myProject.csproj", "{6D7F7B84-F3BD-4A19-A069-D144C345B887}"
EndProject
Please add if there any missing projects. If you have old back up or co-workers file, Just copy and paste missing projects to this file.
In my case it works !!
close vs , delete .vs folder then open vs again. it works for me.
I found that re-adding the existing project to the solution worked for me!
I had to copy out changed files in my workspace, fix my permissions/ownership on my directory (it was no owner instead of me), re-do the mapped drive the workspace was on, re-do the shortcut to the Visual Studio project (even though it was supposed to theoretically be the same place I mapped), re-pull the project down, and copy my changes in again. At this point Visual Studio had the missing solutions in it again so I could set startup project and run the debugger. I'm not sure how the ownership/permissions got messed up. I think at one point the other office had a server go down, and maybe my permissions/ownership got mixed up then. I'm not sure why VS wasn't showing the missing projects, but it's fixed after doing the above.
I had the same issue where my colleague saw 1 more project on his computer.
I deleted my .sln file and got the exact same version as he. Problem was still the same.
Solution was: I had an unloaded project. Apparently this is safed in a local user setting file (probably the .suo file). I looked for the unloaded project and loaded it again.
Close the VStudio entire project, go to the main project folder and click on the .sln file to load the entire project agian.
go to solution explorer see which are having (unload), right click and load project with dependencies
sometimes check if the project startup has changed, if changed just right click on the related project and set as project startup
This .sln file structure breakdown offers a great insight on how projects are able to be found and populated into the project hierarchy. My .sln file had lost all its project persistence blocks and thus I had 0 projects under my solution. I copied the blocks from a a previous git commit and this fixed it. I still don't know why the blocks disappeared or the whole .sln file changed
If the other solutions didn't work for you, then try this.
You can add the missing project to the solution file using the dotnet command. To do so, go to the root folder of your project and run the following command from the terminal:
dotnet sln add ProjectLibrary/ProjectLibrary.csproj
The ProjectLibrary/ProjectLibrary.csproj is the path to your missing project.
You can open the .sln file to confirm if the prject has been added. You should see something like:
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectLibrary", "ProjectLibrary\ProjectLibrary.csproj", "{F042B1DB-F887-44CC-941A-76569A86AF75}"
EndProject
Hope this helps.
I had the same issue. After opening the Visual Studio in Administrator mode it started to work.
Search for VS->Right click-> "Run as administrator"

Rename project folder in Visual studio and Team foundation server

My Visual Studio 2013 solution has a project "Test". I can rename it in solution explorer, but I also want to rename the project folder in disk and also reflect the change in Source Control(TFS). How can I easily do this?
Thank you
#CodeCaster, Thank you. Based on your advice, I have done some quick experiment, and worked it out. First step is rename the folder name in TFS; the new folder will appear in local workspace and all contents of the folder moved to this new folder. The old folder stays there with rest content which not belong to source control. You can delete it manually.
Or
Using TFS Power Tools to rename from Explorer.
I followed those steps to preserve the version history of the files inside of TFS:
Rename/move project file (.csproj) in source control explorer in VS (alternatively, this also works from within VS Solution explorer, simply select "rename")
Rename/move project folder in source control explorer in VS
now the project should be unavailable in VS, solution also gets closed
remove project from VS
add project (new path) to VS
fix project references in other projects
adjust namespaces if desired
adjust assembly name and default namespace in project settings
Don't know of an easier way. Was searching for this myself, and this should be the way to go.
I think you can rename it from the TFS Database.
Try going into tbl_Project of the Tfs_DefaultCollection Database, which you can find on the SQL Server Instance used by tfs. You can know which one is that by going into the TFS Console, click on Application Tier, then find the details of the Server under the Data Tier Summary. Run an update query against the project you want to rename.. I haven't tested this but just assuming it should work (some educated guess)..
I am using TFS 2015 Express and rename project is grayed out.
You can still rename the project using the TFS Site for the project.
Here is a link that shows how to do it.
https://www.visualstudio.com/en-us/docs/setup-admin/rename-team-project
I was facing a similar issue while trying to rename a folder in Visual Studio 2015.This is what I tried.
Right click on the project file
Open with Notepad
This will generate your current solution file
Change the occurences of your prev file name. (Find and Replace with the desired name)
Save it and close
Change solution explorer name and rename the folder to your desired name.
This should work.

Visual Studio and TortoiseHg: folder not visible in VS

I created a C# project and added it to source control (mercurial). I can edit files in VS, commit it and push it using TortoiseHg. It goes to the server. When some one pulls they get the files.
In my visual studio I added a folder and a file inside that folder. I used TortoiseHg and it saw the new file in the new folder. I committed it and pushed it.
However, now someone pulled the latest code from the server - and they got the new file (it is visible through windows explorer), but when they open the solution in VS, they don't see the file.
Does someone have an idea what is wrong here? or things I should check? Thank you for the help.
P.S. I have visual studio 2010 express (so I can't use the VisualHg plugin).
Visual Studio caches changes to the solution and project until an explicit save or a build. In your comment:
In my visual studio I added a folder and a file inside that folder. I used TortoiseHg and it saw the new file in the new folder. I committed it and pushed it.
I see that an updated .sln or .vcproj file was not mentioned and checked in. Did you see an update to either of these files via TortoiseHg? If not, make sure to build or save your project after a change like this.
Did you make sure that the Visual Studio Project File or Solution file is being updated and committed?
VS solution contains projects and each project select managed files by metadata(***.vcproj file). It's not the way include all files from root directory.
So, your co-workers can see new added files by in following two ways.
1) share project file(***.vcproj)
2) manually add files in each person's VS instance.

how to rename a project without killing solution

When I rename a project within a solution, and then try and build that project, I get the error: "The project file "xyz.csproj" was not found. Where xyz is the old project file name!
The annoying thing is that I can search my project & solution for the old project file name, and the search will come up with nothing, and when I click on the error VS does nothing.
So there seems to be no way of finding where the old reference is.
This is a .web project hosting a silverlight page, if that makes any difference.
These are steps I follow when I rename a project:
Click on the project in the solution and rename it. This renames the .proj file and the project name(but not the directory containing the project).
Close solution, rename the project folder. At this stage, the solution still references the old folder.
Open sln file and replace the old folder name with the new one. This should only be in one place. it will look something like this.
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SolutionName", "OldProjectName\NewProjectName.csproj", "{98644DD0-5AB5-4CAC-8D83-CCB8EEEFE234}"
You will need to make it look like this:
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SolutionName", "NewProjectName\NewProjectName.csproj", "{98644DD0-5AB5-4CAC-8D83-CCB8EEEFE234}"
With all visual studio projects, you can usually just close visual studio, edit the solution/project files with a text editor, and reopen visual studio. They're just XML. As long as you're careful not to change anything major, a search & replace in a text editor should do the trick.
OK this was my problem.
I deleted the service reference to the project I renamed, but still got the error message, then via some trial and error adding and removing projects I found that there is a "WCF Ria Services Link" Project property, doh.
That's a bit of a trap.
I also had to rename the namespace and point the project's startup object to the renamed program:
<old_project>.Program to <new_project>.Program

Source Safe 6.0d and Visual Studio 2005 project tree problems

Whenever I try to add a new project to my SourceSafe repository it creates 3 folders with the same name nested within each other. There is only one folder on my drive yet in Sourcesafe there are 3??
Can anyone suggest what may be causing this?
Thanks
If you drag and rop a new project folder into VSS and do a recursive add then that's just how it works. Otherwise you have to create your own root project folder in VSS and add each file one at a time to VSS by hand.
Try creating the project in VS2005 disconnected from source control, then creating the project folder in VSS, set the working folder correctly, add the files to sourcesafe from VSS, then lastly edit the source control bindings in VS2005 and check the bound project into source control.
A little kludgey but this is how I do it.
well, that problem comes due to visual studio. because visual stuio by default save solution file in the my documents/...../.../vs 2008/projects/ location and that address is also saved in the .sln file.
that's why every time you get latest within visual stuio it try to creat same strucute and make another copy with in the main project folder.
Solution, well i still trying to figure out how to tackle it.
cheers,
Genious

Resources