-1

After moving the working code for the githubticketclassifier, a decision tree using the microsoft.ml lightGbm decision tree trainer I had great results and made my own dataset. I then converted it to .net 4.7.2 frameworks in a console environment and it still worked ok. just had some closing of the console I found could be avoided using messagbox popups. Anyway next I tried calling from the autodesk.revit api to send some features and it couldnt finish the model it would create the dataset from the tsv files, however then it would throw an exception. So nothing worked I tried adding it directly to my class that gets called by the revit api and i recieved the following error as soon a i invoke the main method.

Could not load file or assembly 'System.Memory, Version=4.0.1.0, Culture=neutral,

PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies.

The system cannot find the file specified.

This is installed and is the latest version, 4.5.4. I looked at the app.config bindings and i see this...

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
  </dependentAssembly>

i tried changing to the newer version and it made no difference.

  • Have you tried deleting that `` and running `Add-BindingRedirect` in the Package Manager Console? That usually fixes these types of issues. – JosephRT Sep 21 '20 at 11:26
  • Hi Joseph, I will try this fix tonight thanx. – frank holiday Sep 22 '20 at 01:53
  • @Jospeh I had this dialog error raised when in debug mode... System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.' The following row was highlighted by the debugger as identified as part of the problem... case PropertyInfo property: if (!InternalDataKindExtensions.TryGetDataKind(property.PropertyType.IsArray ? property.PropertyType.GetElementType() : property.PropertyType, out dk)) – frank holiday Sep 22 '20 at 09:43
  • The following row was highlighted by the debugger as identified as part of the problem... case PropertyInfo property: if (!InternalDataKindExtensions.TryGetDataKind(property.PropertyType.IsArray ? property.PropertyType.GetElementType() : property.PropertyType, out dk)), this was in the textloader – frank holiday Sep 22 '20 at 10:17

1 Answers1

0

I tried various solutions dealing with the Nuget package manager and was unable to succeed, there may be limitations with the Revit API, I was never able to confirm that. What I eventually did was to create a standalone console .exe in .net frameworks 4.7.2 I then called this with arguments and returned the output from the console. This performed equivalent of a linked or embedded DLL return method.