My XCode workspace doesn't remember added projects when restarted - xcode

I've added Google's GTL project to my project's workspace. It works fine, but every time I open XCode it disappears and I have to add it again. Why can't it remember this project? Is there a cache file or derived data I need to delete and rebuild?

Ensure that you are opening the .xcworkspace, not the .xcodeproj.
When you add the extra project to create a workspace the first time, XCode asks you to save a .xcworkspace file. This is is the file you have to open.

Related

how to stop ".jfm file cannot be accessed" from locking up tfs

I'm working on a project with a large solution in TFS, which includes a sqlProject. There's a few things we use in that project but there's also a .jfm file generated for the project. The .jfm has been excluded from the project but TFS keeps trying to access it. It also shows up under "Excluded Changes" even though I have not made any changes to it.
I've added a .tfignore file with the line
*.jfm
and restarted visual studio and rebooted my computer. This popup persists:
and then I can't open anything in Source Control Explorer, it just keeps giving me the popup. I've googled, spoken to my coworkers, tried moving the .tfignore file around, none of it has worked and it's driving me bonkers.
To ignore the .jfm files you have to ensure that the .tfignore file was checked in to the remote server.
Please try following below steps to fix this issue.:
Delete the .jfm files from TFS via web portal (backup them if needed),
Restart VS, Right click the project node under the collection and
select Get Latest Version to remove the .jfm files from local
workspace.
Set the .tfignore file and check in to the remote server
Then try it again, if that not work, just try to add a new workspace and map the sources in VS,then check in the .tfignore file to the remote server.

Adding files to an Xcode project (SVN)

I "checked out" an SVN repo. The repo contains a few Xcode projects and a workspace. I can open the workspace, build everything, run the app etc. If I make changes to any existing file they will be taken into account when building the app.
Now I want to add two new files to the workspace/project. I want to modify these files and when ready "commit" and "push" (I normally use git) the files to the repo. I added MyClass.h and MyClass.m to the Xcode project via right clicking on the appropriate group in Xcode and selecting "Add file to MyProject...".
The project won't build because MyClass.h can't be found. I also see a warning from the workspace that "MyClass.h is missing from the working copy".
How can I add files to an Xcode project under SVN version control?
I tried the suggestions here Xcode adding new files to existing project in svn but nothing works yet. For example when the files I just added to Xcode are selected the menu option "Add Selected Files" in the Source Control menu is greyed out.
I'm using Xcode 5.
As a work around, you can use smartsvn which has options for adding and removing files in Modify top menu

why is it whenever I open my solution file it always creates a new subfolder?

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.

A file or folder with the name already exists Visual Studio

I try to add a new file to my source controlled solution and receive this message:
A file or folder with the name 'xxx' already exists. Please give a unique
name to the item you are adding, or delete the existing item first.
I'm 100% sure that there is no file with the given name.
So how do I get VS to add items again?
Restarting Visual Studio didn't help, the folder is cached on the system.
Open Solution Explorer there is an icon that looks like a many Pages: which is the Show All Files. Once clicked, one is able to see the hidden, to the visual studio project, the folder that was causing this error. (Look for the folder in the View section.)
After I deleted the unwanted folder, and Rebuild Project, You should be able to Create the controller which will create the view automatically...
Restarting Visual Studio helped me.
Steps if a folder is Missing
In the Solution Explorer window
Select visual studio project which holds the missing folder.
Select or turn on the Show All Files button ( ) to show the existing, but missing folder.
Select the hidden folder then right click and select the menu item Include in Project to add into the project in the project view.
Simply, On Solution Explorer Right CLick on Project's name -> Unload Project.
then right click on the same project and click 'Reload'.
Problem is Fixed (y)
If you're using MVC, and trying to create a new Controller, you should also check the Views and Models. Even though there was no folder or file with the Controller name, I had to delete a View folder with the same name (that already existed for some reason) using Show All Files and rebuild the solution.
I right clicked and removed folder. Then Clicked upper the folder I wanted to create project in and created project. In the Location section I opened the File explorer and the file I had deleted still appeared -> deleted it from here and then went ahead.
I fixed it by actually adding a file and then deleting it again.
The project file was unloaded in visual studio 2017
The easiest way is to copy your project folder and paste different repository then open your project in visual studio then after run the project, it should work.
for example
(D:--------->E:[here i mentioned repository these things])
Visual Studio 2017 v 15.9.12 ... I ran into this problem, but with no actual folder conflict. In my case, I had solution folder named NewOrder, and I was trying to create a child project with the same name, but encountered the above error. I tried closing and reopening the solution (didn't restart VS so not sure if that would have made a difference) but here's what worked for me.
renamed solution folder
created my project. At this point, I got a strange error about not being able to locate the .net standard 2.0... so then I did restart VS, which fixed that problem
renamed the folder back
Now everything works fine. I restarted VS again just for good measure and all works fine now.
In my case, when trying to add a new project to a solution, even though a project with the same name had been removed from the solution in visual studio (2019), I had to open file explorer and delete the folder for the removed project.
I just had a tab open with the file name, closing it solved the issue for me
Click on Show All Files Menu in Solution Explorer and See That file in Controller, Views and Model Folder and delete that from there also
You need to give attention if adding a file automatically add other files/folders..for example if I added a controller which automatically add folder with controller name in views..I couldn't add controller .cs file until I deleted folder with controller name from views.

Automatically include newly added files when pulling from GIT

User 1: creates a new class and commit and push that to git.
User 2: does a git pull. newly created class file gets downloaded but not included in project. Has to right click and do "Include in project"
Is there a way to automatically include a newly added file while doing pull from git?
Do I need to commit any other file (.csproj/.sln) to solve this issue?
IDE: Visual Studio 2010
The project files, .csproj, keep track of which files are loaded in a project. So yes, you will also need to commit the updated project file to the repository in order for User 2 to have the file added to their project as well.
In my experience, even if Visual Studio is open, it will recognize the changed project file and ask if you want to reload it. When you reload it, your project should have the new file loaded.
As an aside, there is a great blog post on why you should get fetch/merge instead of pull

Resources