Xcode resources appear in product after removing from project - resources

Using Xcode 4.0 sometimes when I remove resources from the project they still appear in the app when I run it, both in simulator and device. I remove the resource from the Resources group by removing reference only, but afterwards also remove the actual file in Finder, and yet the resource magically appears in the app.
Doing a project clean did not help.

Xcode 4.0 has a lot of problems managing its projects' "derived data". Try opening the Organizer (Cmd-Shift-2) and clicking the Projects tab. Select your problem project in the source list, then find Delete button next to the Derived Data section near the top. Go ahead and confirm deleting the derived data, then build again (this will take longer as Xcode re-indexes your project).
Does that fix it?

A bundle (and hence also an app) is just a directory, as seen from Unix and Unix-derived tools' point of view.
My guess is that they are still in the bundle because Xcode left a copy there once, and removing the originals in the source directory does not remove the copies in the built app bundle.
If you delete the app from the build directory (or the build directory altogether), you shouldn't see them any more inside a freshly built app.

Related

Can you create a new project while one is open? / Is it possible to duplicate projects?

I seem to only be able to create a new project from the "Quick Start" panel. And this screen is only available when you don't have any projects open.
I know I can close all projects, create a new one, then select File >> open recent if I want multiple projects up. But is it possible to create a new project, say from the File menu while I am already in another project? The only option for creation there is for new files for the current project.
Is it possible to copy/duplicate a project without having to copy/paste the file folders and then import?
I use Android Studio on Windows, so I'm not sure whether it's any different on OSX, but the File menu does allow for creation of new projects.
The screenshot below shows the File menu while a project is open. Note the highlighted item. If this is missing for you then you may have some problem with your installation - or the OSX version is seriously different, but I doubt that.
You could try resetting your installation to default (see here for instructions). Just be sure to backup the config files (instead of deleting them) in case this does not solve your problem.
The only other thing might be different on my system is that I do not use Gradle projects, but I don't really see how that would change this behaviour - but that might be the case.

How to check in a new project to Team Foundation Server?

I created a new project in my solution under a newly created folder. Not just a solution folder. It is placed under a physical folder also.
Say, my original solution is like this:
MySolution
- MySolution.Web
- MySolution.Domain
Now the structure is:
MySolution
- App
- MySolution.Web
- Lib
- MySolution.Domain
- MySolution.Repositories
- MySolution.WorkerServices
- Test
- MySolution.Specs
- MySolution.Unit
Please note in addition to the newly added projects, MySolution.Web and MySolution.Domain are moved to a physical subfolder also.
To move MySolution.Web into the App folder, I moved the files outside Visual Studio and then edit the MySolution.sln manually with a text editor so that the project entry can point to the correct physical location.
Since those two projects are almost empty, I don't really care about losing history.
Then I find I could not check in the change to TFS!
I got Team Foundation Error, saying Could not find a part of the path.
As suggested by comments/answers to this question, I have done an Add Items to Folder in my Source Control Explorer. Now the new folders and projects have a plus sign ahead of their icons. But the MySolution.Web and MySolution.Domain still stubbornly exists in the root. If I try to delete them, it says One or more children have pending changes. It appears TFS tracking failed to understand what I am doing and pending changes are related to those projects even though they are not in existence physically on my local computer.
How can I fix it? What is the correct way to add a project into another folder?
It sounds like you need to add these new folders to source control.
In Source Control Explorer, use the tree view and right-click on the folder above the folders you want to add. You should see an "Add Items to Folder" menu item. Click that, and follow the instructions.
Note that all involved folders must be mapped into your workspace in order for this to work.

How to I get rid of Nuget

I am coming to the conclusion that nuget is not worth all of the issues it has with source control and deployment. So how do I get rid of it? I want to go the old route of putting the referenced dlls in the bin folder and doing the configuration changes as normal.
We have a similar issue, and I can to some degree see your point - the packages folder that NuGet creates at my solution level is good in that it collates the required dependencies into a single folder for use by projects in that solution - BUT it does become a problem when our developers try to push the solution code into source control, as I don't want to store an EntityFramework.dll folder with each solution, and particularly with all of the gumph that comes with it. (Incidentally, I personally don't think that .dlls should even be committed to source control!)
But in terms of your question about getting rid of it, I'm not entirely sure how much it's woven into Visual Studio now, but here's a change you could try out:
Inside Visual Studio, go to the Tools > Options > Package Manager > Package Sources. Un-check the box that makes the 'NuGet official package source' available. This, in theory, should make the NuGet API unavailable to your IDE.
Hope this helps.
My team opted to use NuGet for discovery (we love it for that), separately from our active projects, and to manage our references through another means to achieve control and minimalism. This is how we removed NuGet from those projects:
First, uninstall the NuGet packages in your projects (optionally re-add your references without NuGet at this point, or at the end)
In the same folder as your solution file (.sln) there may be a .nuget folder, which you should delete if no other solutions in that folder rely on NuGet.
In each project folder, delete the packages.config file. If this wasn't checked in to source control, every developer needs to delete packages.config from every project in every branch that is affected.
In each project file (.csproj), there are two lines in the PropertyGroup section that should be deleted:
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == 'Undefined'">...</SolutionDir>
<RestorePackages>true</RestorePackages>
There is also a section at the bottom of each project file (I've seen multiple incarnations at this location, so this is just an example)
<Import Project="$(SolutionDir).nuget\nuget.targets" Condition="Exists('$(SolutionDir).nuget\NuGet.targets')" />
You have to coordinate this with your team. If anyone opens a solution that includes projects with packages.config files in their directories, NuGet will undo the manual edits from above; especially if you have Auto-check turned on.

Using local TFS workspace for non-VisualStudio source code

I am trying to use TFS storing non-VisualStudio source code. Working with Visual Studio 2012 and Microsoft's online Team Foundation Service.
I've setup a TeamProject and mapped its root to a local folder. All it contains at the moment is a BuildProcessTemplates folder in it. (which was created as part of the TeamProject)
I copied my source code externally (using windows explorer) into the TeamProject root folder on my hard drive and since my TFS workspace is NOT a server workspace but rather a local workspace, I was expecting VS to detect the folders/files and show them in Pending Changes window .... yet it doesn't.
Interestingly, new files in the root folder are detected as "Excluded Changes" but new folders are not detected.
What am I missing?
First make sure the newly added folders contains files.
Are there any Detected changes shown in the Excluded Changes section?
Pending Changes > Detected changes link > The Promote Candidate Changes dialog box appears > check the files you want and click Promote.
I can't say I have ever noticed nor expected TFS to automatically pick up files or folders added to a mapped directory as pending changes.
I always just add them manually using the 'Add existing items' option from the source control view.
It may actually do (or at least be meant to do) the auto-detection, but I can't say I've ever relied on it. I don't think it's something to fret too much about - adding them manually is easy enough, and the 'Add existing items' option is usually smart enough to show you which files are not already under source control, so even if you need to add even more files later, it shouldn't be too much extra effort.

TortoiseSvn Folders Can't Commit

Good morning,
I've got an ASP.NET MVC VB2008 .NET 3.5 project I'm upgrading to ASP.NET MVC3 VB2010 .NET 4.0 and it seems to be going OK so far.
I have got it into a working state and all the tests run correctly so it is ready to commit to subversion.
The problem is that to get the tests to update for .NET 4.0 I had to put the classes in a different folder, delete the project and recreate the project in the same place then put the classes back into it.
Now TortoiseSvn can't commit the folders as it already has copies of those folders, even though if I take them out and update the project they're not put back into the project.
Is there any way I can get tortoisesvn to overwrite the old files even though they are technically new files?
Regards,
Harry
You've probably lost the hidden ".svn" folders used to keep track of changes.
Tortoise has an "export" feature. Right-click-and-drag the top level of you modified project to a safe place, choose "Export all here" from the menu.
The check your project out again to a new location, and drop the exported copy on top of it.
Delete any files/folder that shouldn't be there using Tortoise's "Delete" right-click menu item.
It should then be OK to check in, then clean up the mess we've made! :)
I had the same problem as yours. What I did was:
delete the old folder that you have for the project
create a new folder and redo "SVN Checkout"
Then you will have the standard menu back to your SVN.

Resources