CreateKnxProd icon indicating copy to clipboard operation
CreateKnxProd copied to clipboard

Export fails with MissingMethod Exception

Open mgeramb opened this issue 4 years ago • 3 comments

Hello, Unfortunately my try to export a config fails with this error:

System.MissingMethodException: Constructor on type 'Knx.Ets.XmlSigning.ApplicationProgramHasher' not found. at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Activator.CreateInstance(Type type, Object[] args) at CreateKnxProd.Signing.ApplicationProgramHasher..ctor(FileInfo applProgFile, IDictionary`2 mapBaggageIdToFileIntegrity, Boolean patchIds) in C:\Users\mail\CreateKnxProd\Signing\ApplicationProgramHasher.cs:line 16 at CreateKnxProd.MainWindowViewModel.Export(Object param) in C:\Users\mail\CreateKnxProd\MainWindowViewModel.cs:line 684

Did I something wrong? I have a ETS5 and ETS6 installation on my computer, I tried several paths (including the one of the readme.md) in the ETSPath setting without success.

Anyway, nice project! Thank you for your work!

mgeramb avatar Dec 08 '21 20:12 mgeramb

I tried now a older version (https://dev.azure.com/thesing/CreateKnxProd/_build/results?buildId=49&view=results) This works fine, seems to be a issue in one of the latest changes, maybe conversion to .NET 6

mgeramb avatar Dec 08 '21 20:12 mgeramb

You have the current ETS6 installed. The ETS6 changed there signature and broke the reflection call

dos-ise avatar May 30 '22 09:05 dos-ise

using path "ETS6\CV\5.6.241.33672" fixes the reflection call, im guessing this is a copy of ETS5. but then there is a new exception:

"System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.\r\n ---> System.Xml.XmlException: The prefix '' cannot be redefined from 'http://knx.org/xml/project/14' to 'http://knx.org/xml/project/20' within the same start element tag.\r\n at System.Xml.XmlWellFormedWriter.PushNamespaceExplicit(String prefix, String ns)\r\n at System.Xml.XmlWellFormedWriter.WriteEndAttribute()\r\n at System.Xml.XmlWriter.WriteAttributes(XmlReader reader, Boolean defattr)\r\n at System.Xml.XmlWriter.WriteAttributes(XmlReader reader, Boolean defattr)\r\n at Knx.Ets.XmlSigning.ApplicationProgramHasher.HashFile()\r\n --- End of inner exception stack trace ---\r\n at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)\r\n at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)\r\n at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)\r\n at CreateKnxProd.Signing.ApplicationProgramHasher.HashFile() in C:\CreateKnxProd\Signing\ApplicationProgramHasher.cs:line 22\r\n at CreateKnxProd.MainWindowViewModel.Export(Object param) in C:\CreateKnxProd\MainWindowViewModel.cs:line 685"

I dont know where the "project/14" comes from. I tried changing the knx_project.xsd file, but no change.

PedromSilva87 avatar Jun 13 '22 16:06 PedromSilva87