Bug 25750 - Renaming project namespace corrupts TypeSystem cache
Summary: Renaming project namespace corrupts TypeSystem cache
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: unspecified
Hardware: Macintosh Mac OS
: --- enhancement
Target Milestone: master
Assignee: Jeffrey Stedfast
URL:
Depends on:
Blocks:
 
Reported: 2015-01-06 13:34 UTC by Jon Goldberger [MSFT]
Modified: 2017-07-19 20:21 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NOT_REPRODUCIBLE

Description Jon Goldberger [MSFT] 2015-01-06 13:34:45 UTC
## Description

After performing a "Clean" of an iOS project, there are still files stored in 
~/Library/Caches/XamarinStudio-5.0/DerivedData

This caused a major issue for one of our customers as after renaming the main namespace for a project, for example from:

my.namespace

to

My.NameSpace

After doing this rename, opening any .xib file resulted in an error:

>System.ArgumentException: Multiple types (Client.Touch.AppDelegate and client.Touch.AppDelegate) registered with the same Objective-C name: AppDelegate
>at MonoDevelop.MacDev.ObjCIntegration.NSObjectProjectInfo.Update () [0x0010d] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-5.5-branch/f93940a3/source/md-addins/MonoDevelop.MacDev/MonoDevelop.MacDev/ObjCIntegration/NSObjectProjectInfo.cs:88 
>at MonoDevelop.MacDev.ObjCIntegration.NSObjectProjectInfo.Update (Boolean force) [0x0000e] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-5.5-branch/f93940a3/source/md-addins/MonoDevelop.MacDev/MonoDevelop.MacDev/ObjCIntegration/NSObjectProjectInfo.cs:65 
>at MonoDevelop.MacDev.XcodeSyncing.XcodeProjectTracker.UpdateTypes (IProgressMonitor monitor) [0x00040] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-5.5-branch/f93940a3/source/md-addins/MonoDevelop.MacDev/MonoDevelop.MacDev/XcodeSyncing/XcodeProjectTracker.cs:503 

This was due to there now being two classes called AppDelegate that used the attribute:
 
[Register("AppDelegate")]

One was my.namespace.AppDelegate and the other was My.Namespace.AppDelegate.

Deleting the contents of the ~/Library/Caches/XamarinStudio-5.0/DerivedData folder resolved this issue. It would be nice, if possible, for "clean" to clear this cache folder as well.
Comment 7 Tom Opgenorth 2017-07-19 20:21:07 UTC
Thanks so much for taking the time to submit this report! I attempted to reproduce this issue based on the bug description with the latest Visual Studio 2017 for Mac Preview version 7.1, and I was unable to hit the problem. If this issue is still occurring for you, please reopen this report and attach a reproduction, ideally starting with a new template project and then adding just the code necessary to demonstrate the issue.