I have a DSL, that dynamically loads an external assembly (The end-user can indicate where the DSL can find the assembly). After the DSL loads the external assembly, it creates a DomainClass that represents a class in the Assembly.
The DomainClass has some DomainProperties
- a string name
- a string namespace
- a Type type
This all works. All the properties are set correctly. When I close the DSL, the data gets serialized. When opening the DSL again, the data gets deserialized, but there is a warning. The warning sais: "Invalid property value 'AAEAAAD/////AQAAAAAAAAAEAQAAAB9TeXN0ZW0uVW5pdHlTZXJpYWxpemF0aW9uSG9sZGVyAwAAAAREYXRhCVVuaXR5VHlwZQxBc3NlbWJseU5hbWUBAAEIBgIAAAAYRGVidWdnaW5nLlBpbXNwYWNlLlBldFtdBAAAAAYDAAAASkNvbnNvbGVBcHBsaWNhdGlvbjEsIFZlcnNpb249MS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1udWxsCw==' for property 'type' with type 'Type', ignored.
I believe this is because the DSL hasn't loaded the external assembly, and can't figure out what the Type is.
When saving and closing the DSL again, the DSL clears the DomainProperty type, and doesn't serialize it.
When opening the DSL again, there are no warning, because the type has become null.
I have tried loading the external assembly in the OnDocumentLoading in MyDslDocData:
Code Snippet
protected override void OnDocumentLoading(EventArgs e)
{
byte[] bytes = File.ReadAllBytes(@"C:\Documents and Settings\pvendrig\Mijn documenten\Visual Studio 2005\Projects\NHibernate\ConsoleApplication1\obj\Debug\ConsoleApplication1.exe");
AppDomain.CurrentDomain.Load(bytes);
base.OnDocumentLoading(e);
}
The DSL still gives the warning.
Does somebody perhaps know a way of loading the external assembly, so the DSL will recognise the Type, and won't give warnings
Thanks in advance,
Pim Vendrig