XmlSchemaClassGenerator icon indicating copy to clipboard operation
XmlSchemaClassGenerator copied to clipboard

Unhandled Exception: System.TypeLoadException: Could not load type 'List' from assembly

Open lucky85008 opened this issue 6 months ago • 1 comments

Hi

This tool looks very promising, and I’d like to use it with our ECF XSDs. However, I’m encountering an error during the process.

I’ve attached a ZIP file containing the XSDs along with the error details. Could you please review and advise?

thanks Lucky

Error is

Unhandled Exception: System.TypeLoadException: Could not load type 'List' from assembly 'XmlSchemaClassGenerator.Console, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null'. at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) at System.Type.GetType(String typeName, Boolean throwOnError) at XmlSchemaClassGenerator.Console.Program.<>c__DisplayClass0_0.<Main>b__23(String v) at Mono.Options.Option.Invoke(OptionContext c) at Mono.Options.OptionSet.Parse(String argument, OptionContext c) at Mono.Options.OptionSet.Parse(IEnumerable`1 arguments) at XmlSchemaClassGenerator.Console.Program.Main(String[] args)

ECF_XsdConversionSetup.zip

lucky85008 avatar Jun 22 '25 08:06 lucky85008

You need to specify the fully qualified type name, e.g, --ct System.Collections.Generic.List`1. Also, some of the other options like --outputTypes do not exist in xscgen.

I suggest starting from a minimal command line and then tweak to your liking. Specifying all the xsd files on the command line (**/*,xsd) didn't work for me, perhaps because there are duplicated xsd files. However, specifying xsd/message/*.xsd worked.

mganss avatar Jul 10 '25 11:07 mganss