Bug 3718 - Deleting mono breaks Mono for Android
Summary: Deleting mono breaks Mono for Android
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 4.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2012-03-02 07:07 UTC by Alan McGovern
Modified: 2012-03-02 14:48 UTC (History)
2 users (show)

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:

Description Alan McGovern 2012-03-02 07:07:19 UTC
I had to downgrade my mono recently from 2.10.9 to to verify a bug. Unfortunately it is impossible to install an older mono on top of a newer mono, so I just deleted my /Library/Frameworks/Mono.framework directory and reinstalled the old mono. However the Mono for Android installer places files inside this directory, so the result was that when I tried to use Mono for Android an hour later, my installation was broken with a cryptic error message.

Do we have to install the targets file inside the Mono.framework directory or is there any way to robustify this against the user downgrading their mono version?

---> Microsoft.Build.BuildEngine.InvalidProjectFileException: /Users/alanmcgovern/Projects/AndroidApp/AndroidApp/AndroidApp.csproj: /Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/xbuild/Novell/Novell.MonoDroid.CSharp.targets: Project file could not be imported, it was being imported by /Users/alanmcgovern/Projects/AndroidApp/AndroidApp/AndroidApp.csproj: Imported project: "/Library/Frameworks/Mono.framework/Versions/2.10
.9/lib/mono/xbuild/Novell/Novell.MonoDroid.CSharp.targets" does not exist. ---> Microsoft.Build.BuildEngine.InvalidProjectFileException: /Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/xbuild/Novell/Novell.MonoDroid.CSharp.targets: Project file could not be imported, it was being imported by /Users/alanmcgovern/Projects/AndroidApp/AndroidApp/AndroidApp.csproj: Imported project: "/Library/Frameworks/Mono.framework/Versions/
2.10.9/lib/mono/xbuild/Novell/Novell.MonoDroid.CSharp.targets" does not exist. ---> Microsoft.Build.BuildEngine.InvalidProjectFileException: Imported project: "/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/xbuild/Novell/Novell.MonoDroid.CSharp.targets" does not exist.
Comment 1 Mikayla Hutchinson [MSFT] 2012-03-02 14:08:28 UTC
You shouldn't delete /Library/Frameworks/Mono.framework. If you want to delete Mono manually, use /Library/Frameworks/Mono.framework/Versions/{Current|version}.

Xbuild targets and MonoDoc docs have to go somewhere that Mono knows to look for them. We purposely created /Library/Frameworks/Mono.framework/External for such externally-installed files so they will survive Mono upgrades and uninstallations. Do you have a better location to suggest?
Comment 2 Chris Hardy [MSFT] 2012-03-02 14:47:44 UTC
This document states to remove that directory so we probably want to update it;

Comment 3 Chris Hardy [MSFT] 2012-03-02 14:48:55 UTC
or at least add in a section that shows you how to downgrade an installation, or get the Mono installer to do this automatically so users don't have to manually do this.