Bug 379 - Cannot enable the C# binding
Summary: Cannot enable the C# binding
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Project Model ()
Version: Trunk
Hardware: PC Mac OS
: Normal major
Target Milestone: ---
Assignee: Lluis Sanchez
Depends on:
Reported: 2011-08-24 07:09 UTC by Alan McGovern
Modified: 2013-03-22 07:36 UTC (History)
3 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 2011-08-24 07:09:06 UTC
I was looking through my addin manager and noticed that the CSharp Binding addin was disabled. I tried to enable it and got this, which means I cannot enable it:

Exception occurred: Cannot add second policy of type '[Policy: Type=MonoDevelop.CSharp.Formatting.CSharpFormattingPolicy, scope=text/x-csharp]' to policy set 'Mono'

System.InvalidOperationException: Cannot add second policy of type '[Policy: Type=MonoDevelop.CSharp.Formatting.CSharpFormattingPolicy, scope=text/x-csharp]' to policy set 'Mono'
  at MonoDevelop.Projects.Policies.PolicySet.AddSerializedPolicies (System.IO.StreamReader reader) [0x00052] in /Users/alanmcgovern/Projects/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Policies/PolicySet.cs:99 
  at MonoDevelop.Projects.Extensions.PolicySetNode.OnChildNodeAdded (Mono.Addins.ExtensionNode node) [0x0000e] in /Users/alanmcgovern/Projects/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/PolicySetNode.cs:57 
  at Mono.Addins.ExtensionNode.NotifyChildChanged () [0x000ae] in /private/tmp/monobuild/build/BUILD/mono-addins-0.6.1/Mono.Addins/Mono.Addins/ExtensionNode.cs:471 
  at Mono.Addins.TreeNode.NotifyChildrenChanged () [0x0000b] in /private/tmp/monobuild/build/BUILD/mono-addins-0.6.1/Mono.Addins/Mono.Addins/TreeNode.cs:334 
  at Mono.Addins.ExtensionTree.LoadExtensionElement (Mono.Addins.TreeNode tnode, System.String addin, Mono.Addins.Description.ExtensionNodeDescriptionCollection extension, Mono.Addins.Description.ModuleDescription module, System.Int32& curPos, Mono.Addins.BaseCondition parentCondition, Boolean inComplextCondition, System.Collections.ArrayList addedNodes) [0x00275] in /private/tmp/monobuild/build/BUILD/mono-addins-0.6.1/Mono.Addins/Mono.Addins/ExtensionTree.cs:136 
  at Mono.Addins.ExtensionTree.LoadExtension (System.String addin, Mono.Addins.Description.Extension extension, System.Collections.ArrayList addedNodes) [0x0003e] in /private/tmp/monobuild/build/BUILD/mono-addins-0.6.1/Mono.Addins/Mono.Addins/ExtensionTree.cs:64 
  at Mono.Addins.ExtensionContext.LoadModuleExtensionNodes (Mono.Addins.Description.Extension extension, System.String addinId, Mono.Addins.Description.ExtensionNodeSet nset, System.Collections.ArrayList loadedNodes) [0x00006] in /private/tmp/monobuild/build/BUILD/mono-addins-0.6.1/Mono.Addins/Mono.Addins/ExtensionContext.cs:1138 
  at Mono.Addins.ExtensionContext.ActivateAddinExtensions (System.String id) [0x001b6] in /private/tmp/monobuild/build/BUILD/mono-addins-0.6.1/Mono.Addins/Mono.Addins/ExtensionContext.cs:890 
  at Mono.Addins.AddinEngine.ActivateAddin (System.String id) [0x00000] in /private/tmp/monobuild/build/BUILD/mono-addins-0.6.1/Mono.Addins/Mono.Addins/AddinEngine.cs:389 
  at Mono.Addins.Database.AddinDatabase.EnableAddin (System.String domain, System.String id, Boolean exactVersionMatch) [0x000db] in /private/tmp/monobuild/build/BUILD/mono-addins-0.6.1/Mono.Addins/Mono.Addins.Database/AddinDatabase.cs:477 
  at Mono.Addins.Addin.set_Enabled (Boolean value) [0x00006] in /private/tmp/monobuild/build/BUILD/mono-addins-0.6.1/Mono.Addins/Mono.Addins/Addin.cs:170 
  at Mono.Addins.Gui.AddinManagerDialog.OnEnableDisableClicked (System.Object sender, System.EventArgs e) [0x0001e] in /private/tmp/monobuild/build/BUILD/mono-addins-0.6.1/Mono.Addins.Gui/Mono.Addins.Gui/AddinManagerDialog.cs:484
Comment 1 Mike Krüger 2011-08-24 07:10:27 UTC
It seems to be a bug with the policy system.
Comment 2 Lluis Sanchez 2013-03-11 09:35:08 UTC
Fixed in master
Comment 3 Jatin 2013-03-22 07:36:27 UTC
Today we have verified this issue with the latest builds:

All Mac and Windows
MFA 4.6.01079
Mono 2.10.12

And now this issue is not appearing, as now the exception does not appear when we enable the C# bindings.

Below is the screencast for the same:

Mac: http://www.screencast.com/t/DkdfIa9b
Windows: http://www.screencast.com/t/NfrPjGhDBrE

Hence, closing this issue.