Have Demo getting started question

SyntaxEditor for Windows Forms Forum

Posted 17 years ago by travis hawkins
Avatar
I'm trying to load a premade language file for my editor:

Editor.Document.LoadLanguageFromXml("c:\syntax\ActiproSoftware.PHP.xml", 0)

and it keeps giving me an unhandled exception error. I thought it was not finding the XML file but I've verified the location.

Any idea what I'm doing wrong?

-Travis

Comments (7)

Posted 17 years ago by billb - Software Craftsman, Yye Software
Avatar
What's the exception? Is it FileNotFound?
Posted 17 years ago by travis hawkins
Avatar
No, It didn't say "File not found"

ActiproSoftware.SyntaxEditor.InvalidLanguageDefinitionException was unhandled
Message="An error occurred while loading the DynamicSyntaxLanguage '{Unknown}':
The syntax language type 'TestApplication.HtmlDynamicSyntaxLanguage, TestApplication' could not be loaded. Please see the 'Troubleshooting' topic in the documentation for details on how to resolve this error.
The problem occurred near line 1, position 2
in Unknown Stream."
Source="ActiproSoftware.SyntaxEditor.Net20"


Let me know if the stack trace would make any difference.
Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Travis,

Some languages have code-behind classes that are specified in their root tag. In this case you are trying to load the HTML language, which has an HtmlDynamicSyntaxLanguage class that it requires to be in your project.

As the exception message says, the Troubleshooting topic explains this in detail so please read that topic and it will tell you what to do to get it working in your project.


Actipro Software Support

Posted 17 years ago by travis hawkins
Avatar
ok, Thanks...

That got me moving again. My problem now is that it keeps trying to look in the "TestApplication" for this class. I included the Class in my own project but it's still looking in the "TestApplication". I tried including it in my project but leaving the namespace "TestApplication" for that class and still it can't find it.

What am I missing?
Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
By default it looks for:
TestApplication.HtmlDynamicSyntaxLanguage, TestApplication

So you need to change that in the root SyntaxLanguage tag in the XML to match whatever you have in you assembly. If you leave it in the TestApplication namespace but your app's assembly is called TravisAssembly then you would change the XML to this:

TestApplication.HtmlDynamicSyntaxLanguage, TravisAssembly

If you look at the docs for the SyntaxLanguage tag in the dynamic language reference, you will find more info on this attribute as well.


Actipro Software Support

Posted 17 years ago by travis hawkins
Avatar
Ok, I tried a bunch of ways to edit that:
SyntaxLanguageTypeName section of the XML but nothing seemed to help. So I took them all out, I had to take them out of HTML, VBSCRIPT, CSS, and JScript. Once that was done it worked??

Does that mean I'm a bad person? Is some part of it NOT going to be working? Is something still setup wrong?

Thanks
Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
By not including the code-behind, you will not have outlining support and other features that may be implemented (although in the samples, it's mostly just outlining).

It should be very easy to set it up and the documentation explains it in several places:
#1: "SyntaxEditor Dynamic Languages Guide / Loading and Saving"
#2: "SyntaxEditor Dynamic Language XML Definition Specification / SyntaxLanguage Tag"

The attribute name is "SyntaxLanguageTypeName". You just set it to the full type name and assembly location of the code-behind classs. If your class name is "HtmlDynamicSyntaxLanguage" and it's in the "TestApplication" namespace, and it's in the assembly called "TravisAssembly", then you would do:
SyntaxLanguageTypeName="TestApplication.HtmlDynamicSyntaxLanguage, TravisAssembly"


Actipro Software Support

The latest build of this product (v24.1.0) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.