Bug 1588 - Error loading policy file 'Default.mdpolicy.xml'
Summary: Error loading policy file 'Default.mdpolicy.xml'
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: General ()
Version: Trunk
Hardware: PC Windows
: Low normal
Target Milestone: ---
Assignee: Lluis Sanchez
URL:
: 6120 10547 ()
Depends on:
Blocks:
 
Reported: 2011-10-19 19:06 UTC by Mikayla Hutchinson [MSFT]
Modified: 2015-08-21 06:03 UTC (History)
6 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 FIXED

Description Mikayla Hutchinson [MSFT] 2011-10-19 19:06:19 UTC
From http://lists.ximian.com/pipermail/monodevelop-list/2011-October/014079.html:

Error - 08:47:43 - Error loading policy file 'Default.mdpolicy.xml' file 
'%USERPROFILE%\AppData\Roaming\MonoDevelop-2.8\Policies\Default.mdpolicy.xml':
System.InvalidOperationException: Could not set property 'Text' in type 
'StandardHeader' ---> System.InvalidCastException: Unable to cast object 
of type 'MonoDevelop.Core.Serialization.DataItem' to type 
'MonoDevelop.Core.Serialization.DataValue'.

at 
MonoDevelop.Core.Serialization.PrimitiveDataType.OnDeserialize(SerializationContext 
serCtx, Object mapData, DataNode data)
at MonoDevelop.Core.Serialization.DataSerializer.OnDeserialize(DataType 
dataType, SerializationContext serCtx, Object mapData, DataNode data)
at 
MonoDevelop.Core.Serialization.DataType.Deserialize(SerializationContext 
serCtx, Object mapData, DataNode data)
at 
MonoDevelop.Core.Serialization.ItemProperty.OnDeserialize(SerializationContext 
serCtx, DataNode data)
at 
MonoDevelop.Core.Serialization.DataSerializer.OnDeserializeProperty(ItemProperty 
prop, SerializationContext serCtx, Object instance, DataNode data)
at 
MonoDevelop.Core.Serialization.ItemProperty.Deserialize(SerializationContext 
serCtx, Object instance, DataNode data)
at 
MonoDevelop.Core.Serialization.ClassDataType.Deserialize(SerializationContext 
serCtx, Object obj, DataCollection itemData, DataItem ukwnDataRoot, 
String baseName)
--- End of inner exception stack trace ---
at 
MonoDevelop.Core.Serialization.ClassDataType.Deserialize(SerializationContext 
serCtx, Object obj, DataCollection itemData, DataItem ukwnDataRoot, 
String baseName)
at 
MonoDevelop.Core.Serialization.ClassDataType.DeserializeNoCustom(SerializationContext 
serCtx, Object obj, DataCollection itemData)
at 
MonoDevelop.Core.Serialization.ClassDataType.OnDeserialize(SerializationContext 
serCtx, Object mapData, DataNode data, Object obj)
at MonoDevelop.Core.Serialization.DataSerializer.OnDeserialize(DataType 
dataType, SerializationContext serCtx, Object mapData, DataNode data, 
Object valueInstance)
at 
MonoDevelop.Core.Serialization.DataType.Deserialize(SerializationContext 
serCtx, Object mapData, DataNode data, Object valueInstance)
at 
MonoDevelop.Core.Serialization.ClassDataType.OnDeserialize(SerializationContext 
serCtx, Object mapData, DataNode data)
at MonoDevelop.Core.Serialization.DataSerializer.OnDeserialize(DataType 
dataType, SerializationContext serCtx, Object mapData, DataNode data)
at 
MonoDevelop.Core.Serialization.DataType.Deserialize(SerializationContext 
serCtx, Object mapData, DataNode data)
at 
MonoDevelop.Core.Serialization.DataContext.LoadConfigurationData(SerializationContext 
serCtx, Type type, DataNode data)
at MonoDevelop.Core.Serialization.DataSerializer.Deserialize(Type type, 
DataNode data)
at MonoDevelop.Projects.Policies.PolicyService.RawDeserialize(DataNode data)
at MonoDevelop.Projects.Policies.PolicyService.DiffDeserialize(DataItem 
item)
at 
MonoDevelop.Projects.Policies.PolicyService.<DiffDeserializeXml>d__a.MoveNext()
at MonoDevelop.Projects.Policies.PolicySet.LoadFromXml(XmlReader reader)
at 
MonoDevelop.Projects.Policies.PolicyService.<LoadPolicy>b__37(StreamReader 
reader)
at MonoDevelop.Projects.Policies.PolicyService.ParanoidLoad(String 
fileName, String friendlyName, Action`1 read)


my 
%USERPROFILE%\AppData\Roaming\MonoDevelop-2.8\Policies\Default.mdpolicy.xml:

<?xml version="1.0" encoding="utf-8"?>
<Policies>
<PolicySet name="Default" id="Default">
<DotNetNamingPolicy>
<DirectoryNamespaceAssociation>None</DirectoryNamespaceAssociation>
<ResourceNamePolicy>FileFormatDefault</ResourceNamePolicy>
</DotNetNamingPolicy>
<TextStylePolicy inheritsSet="null" scope="application/xml" />
<XmlFormattingPolicy inheritsSet="Mono" inheritsScope="application/xml" 
scope="application/xml" />
<TextStylePolicy inheritsSet="Mono" inheritsScope="text/plain" 
scope="text/plain">
<FileWidth>90</FileWidth>
<TabWidth>4</TabWidth>
</TextStylePolicy>
<TextStylePolicy inheritsSet="null" scope="text/x-csharp" />
<CSharpFormattingPolicy inheritsSet="Mono" inheritsScope="text/x-csharp" 
scope="text/x-csharp" />
<VersionControlPolicy inheritsSet="Mono" />
<StandardHeader>
<Text />
<IncludeInNewFiles>True</IncludeInNewFiles>
</StandardHeader>
</PolicySet>
</Policies>
Comment 1 Alex 2011-11-13 00:04:40 UTC
Also affects to me. Setting <Text /> to "<Text>some text</Text>" helps.
Comment 2 Edwin Klesman 2012-10-16 09:04:20 UTC
I removed the <Text /> element all together so it says:

<StandardHeader>
<IncludeInNewFiles>True</IncludeInNewFiles>
</StandardHeader>

That stopped the complaining of the compiler as well
Comment 3 Mikayla Hutchinson [MSFT] 2013-02-22 18:28:35 UTC
*** Bug 10547 has been marked as a duplicate of this bug. ***
Comment 4 Mikayla Hutchinson [MSFT] 2013-02-22 18:47:10 UTC
This is reproducible. Simply create a custom policy with a blank standard header.
Comment 5 Mikayla Hutchinson [MSFT] 2013-02-22 19:46:46 UTC
Fixed.
Comment 6 Lluis Sanchez 2015-08-21 06:03:19 UTC
*** Bug 6120 has been marked as a duplicate of this bug. ***