Error inheriting from SyntaxEditor

SyntaxEditor for Windows Forms Forum

Posted 18 years ago by Jason Whitted - Owner, Etalisoft, LLC
Avatar
Since the SyntaxEditor class is not sealed, I assume we should be able to inherit from it.
public class SyntaxEditor2 : ActiproSoftware.SyntaxEditor.SyntaxEditor
{
   public SyntaxEditor2() : base()
   {
   }
}
The project builds fine with this, and the application runs fine; however, in the Visual Studio 2005 Form Designer I am receiving this error:
An error occurred while parsing EntityName. Line 2, position 51. 
  at System.Xml.XmlTextReaderImpl.Throw(Exception e)
  at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
  at System.Xml.XmlTextReaderImpl.ParseEntityName()
  at System.Xml.XmlTextReaderImpl.ParseAttributeValueSlow(Int32 curPos, Char quoteChar, NodeData attr)
  at System.Xml.XmlTextReaderImpl.ParseAttributes()
  at System.Xml.XmlTextReaderImpl.ParseElement()
  at System.Xml.XmlTextReaderImpl.ParseElementContent()
  at System.Xml.XmlTextReaderImpl.Read()
  at System.Xml.XmlTextReader.Read()
  at Microsoft.VisualStudio.Design.VSTypeResolutionService.GeneratedAssemblyEntry.RealizeMoniker(String moniker)
  at Microsoft.VisualStudio.Design.VSTypeResolutionService.GeneratedAssemblyEntry.get_FileName()
  at Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.get_Assembly()
  at Microsoft.VisualStudio.Design.VSTypeResolutionService.GeneratedAssemblyEntry.get_Assembly()
  at Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.Search(String fullName, String typeName, Boolean ignoreTypeCase, Assembly& assembly, String description)
  at Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchGeneratedEntries(AssemblyName assemblyName, String typeName, Boolean ignoreTypeCase, Assembly& assembly)
  at Microsoft.VisualStudio.Design.VSTypeResolutionService.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, ReferenceType refType)
  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 System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost host)
Is this a bug? Any work arounds for it? Or should I just not inherit from SyntaxEditor?

Comments (2)

Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
No you should be able to inherit a SyntaxEditor class fine. We've found the VS 2005 RTM to be extremely buggy, even when not using our controls at all. For all the time that Microsoft had it out in beta, you would think that it would have been much more stable than it is.

Anyhow back on this issue, we implemented your code and got a different VS designer error:
The type 'ActiproSoftware.SyntaxEditor.SyntaxEditor2' has no field named 'AllowDrop'. 
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.Error(IDesignerSerializationManager manager, String exceptionText, String helpLink)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager manager, CodeStatement statement)
I did a Google on this and found that the exception we got is a bug in VS 2005 that others have gotten too. (Few minutes later) Ok, now I closed the VS application, and reopened the solution. Then I went to the designer and it worked fine and opened ok with no changes whatsoever.

So I did get it working by closing the solution after making that code change and reopening the solution.


Actipro Software Support

Posted 18 years ago by Jason Whitted - Owner, Etalisoft, LLC
Avatar
I found the solution to the problem I was experiencing. My Visual Studio solution / projects were located in a directory named 'R&D'. When I moved the solution to a directory named 'Research', it fixed the problem. Apparently Visual Studio has a bug in it with path resolution when there are ampersan characters. They must not be XML escaping paths before they save the configuration files. That would also explain the error message 'An error occurred while parsing EntityName.'.
The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.