I'm writing a C# program (DLL) using Microsoft's ML.Net nuget packages that is being launched (executed) from another program. This is a requirement, unfortunately and it must be done this way--I am compiling everything and linking it with Fody Costura into a DLL and it's being executed by the other application (of which I do not have its source code).
In the past, I was using ML.Net 1.6.0 and I was not able to save models, however the DLL launched and worked fine. At that point, when I called the mlContext.Model.Save() method it threw a System.ArgumentException "The path is not of a legal form" tracing back to the Microsoft.ML.RepositoryWriter.CreateNew() method; I believe there's an issue where the assembly location is being read incorrectly.
I created a new copy the application and updated the ML.Net libraries (Just updated ML.Net to 2.0) and somehow, I was able to save the models. I updated the code, might have changed a package and it stopped working, throwing the same exception.
I've gone through all sorts of different versions of ML.Net and I can't get it to work. I literally tried every combination of versions of the ML.Net packages and LightGBM.
Interestingly, the original version of the program also had no issues being loaded by the executing assembly, with everything embedded as a resource by Fody Costura. Now, however, it won't run and throws an error that all of the necessary libraries cannot be found.
If I run procmon64 and observe what's going on, I see that it cannot find Microsoft.ML.LightGbm.dll, although it's been referenced, linked, and also embedded into the library. If I place this library in the root directory of the executing application, it loads fine. I tried installing the exact same versions in Nuget and it doesn't fix the issue.
Sort of at wits end here with all this mess trying to get it to work.
I repeated my process of copying the original application, copying over my updated code, and upgrading ML.Net to 2.0 and have been able to get things working again.
Still interested in why it broke and what steps I could take in the future to troubleshoot such things. At the moment I plan to STAY on the current versions of the packages.
Any advice or information is much appreciated.
Thanks in advance.