Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Monday, May 4, 2009 5:15 PM
I have a VB.NET project with several form objects included. Last Friday, all of a sudden and without having added any new software to my computer, I can no longer open many of my form objects. I get the message found in the subject of this post and the following Call Stack:
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
at System.Xml.XmlTextReaderImpl.Throw(Int32 pos, String res, String[] args)
at System.Xml.XmlTextReaderImpl.ParseQName(Boolean isQName, Int32 startOffset, Int32& colonPos)
at System.Xml.XmlTextReaderImpl.ParseElement()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)
at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.Load(TextReader txtReader)
at Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSerializer.Deserialize(DesignTimeSettings Settings, TextReader Reader, Boolean getRuntimeValue)
at Microsoft.VisualStudio.Editors.SettingsGlobalObjects.SettingsFileGlobalObject.LoadSettings(String fileName)
at Microsoft.VisualStudio.Editors.SettingsGlobalObjects.SettingsFileGlobalObject.BuildType()
at Microsoft.VisualStudio.Editors.SettingsGlobalObjects.SettingsFileGlobalObject.GetObjectType()
at Microsoft.VisualStudio.Shell.Design.GlobalType.get_ObjectType()
at Microsoft.VisualStudio.Shell.Design.GlobalObject.GetHashCode()
at Microsoft.VisualStudio.Shell.Design.GlobalObjectService.GlobalKey.GetHashCode()
at System.Collections.Generic.ObjectEqualityComparer`1.GetHashCode(T obj)
at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
at Microsoft.VisualStudio.Shell.Design.GlobalObjectService.GetGlobalObjects(Type baseType)
at Microsoft.VisualStudio.Shell.Design.GlobalObjectService.GetGlobalObjects()
at Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetTypeFromGlobalObjects(String name, Boolean throwOnError, Boolean ignoreCase)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetType(String name, Boolean throwOnError)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.GetType(ITypeResolutionService trs, String name, Dictionary`2 names)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.FillStatementTable(IDesignerSerializationManager manager, IDictionary table, Dictionary`2 names, CodeStatementCollection statements, String className)
at System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, CodeTypeDeclaration declaration)
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)
This is not the case on all my forms as some of them can still be opened. Any modification to the form that can still be opened cannot be saved because upon a save, I get a very similar message:
*"Code generation for property 'ContextMenu' failed. Error was 'Name cannot begin with the '<' character, hexadecimal value 0x3C. Line 2, position 2.'
*The application runs fine, I just can't open or change any of the forms.
All replies (4)
Tuesday, May 5, 2009 6:50 AM âś…Answered | 3 votes
Hi Mark,
It looks like one or more XML files in your project were somehow corrupted. I can reproduce the error message in my own test project by manually corrupting the Settings.settings file if the Form (or its controls) has any properties bound to my application settings.
So my suggestion is to check all the XML files that has any relations to your Form (like some properties bound to the settings or resources you've set in the designer previously), if you found any errors in these XML files, you can try fix them manually and see if the Form can be opened in designer again.
Files like Application.myapp, *.resx, *.settings, *.config, *.xml.
BTW, if you could let me know what version of Visual Studio you're using, it would also be helpful to the troubleshooting.
Thanks,
JieThis posting is provided "AS IS" with no warranties, and confers no rights.
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Send us any feedback you have about the help from MSFT at [email protected].
The CodeFx Project
My Blog (CHS)
Wednesday, November 11, 2009 10:04 AM | 1 vote
I had a similar (if not exactly the same) experience using a 'generic' xsl file.
My problem was fixed by escaping the problem chars using
< to replace <
> to replace **>
** Hope this helps!
Friday, July 19, 2013 1:18 PM | 5 votes
I had the same problem, and Jay is exactly correct. But let me add more...
In my case, Subversion was trying to resolve the differences in the settings file. When SVN does this, it adds a section to a file that looks something like:
<<<<<<<<<<<<<<<
Mine
>>>>>>>>>>>>>>>
This caused the "Name cannot begin with a '<' error'.
Let me also add that this is one of the things that bugs me about the lazy error handling (exception generation) done by Microsoft (and others). By not including context information (such as the file name... really guys??) when throwing exceptions, it becomes much(!!) more difficult to make sense of a stack dump.
BTW: Not only did it throw this error, but it confused the h*ll out of CodeRush.
Thanks Jay!!
Wednesday, September 14, 2016 6:38 AM
Thank you! This was exactly the information I needed.
A quick find in files for "<<<<<<<<<<<<<" found me the conflicting file and I was able to edit the parts that SVN added