简体   繁体   中英

.exe dependency cannot find .dll

I am trying to read some proprietary files using a proprietary library. This library comes with a .exe file which, sometime in the middle of the process is called. This file, however, throws the error below.

Unhandled Exception: System.Exception: HarvestCalibration Error: Expecting element 'root' from namespace ''.. Encountered 'None'  with name '', namespace ''.

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'AgLeaderCalibration.dll' or one of its dependencies. The specified module could not be found.
   at HarvestCalibration.Program.buildTable(CalibrationInput config)
   at HarvestCalibration.Program.Main(String[] args)

   at CNHVoyager2.HarvestCalibration.CalibrationShim.get_config()
   at CNHVoyager2.HarvestCalibration.CalibrationShim.CalculateSampleFlow(UInt16 sensor_force, Double moisture_percent)
   at CNHVoyager2.V2_RecordHarvestSummary.CalculateSampleFlow(UInt16 sensor_force, Double moisture_percent)
   at CNHVoyager2.CNHV2DatasetSample.FillHarvestAttributeCollection()
   at CNHVoyager2.CNHV2DatasetSample.get_AttributeCollection()
   at test.Program.CreateProperties(ICNHV2DatasetSample sample) in C:\Users\Joao\leaf\test\Program.cs:line 84
   at test.Program.Convert(String inputCN1) in C:\Users\Joao\leaf\test\Program.cs:line 61
   at test.Program.Main(String[] args) in C:\Users\Joao\leaf\test\Program.cs:line 36

A quick search shows that Expecting element 'root' from namespace ''.. Encountered 'None' with name '', namespace '' is a problem when reading buffers [ 1 ]. However, I think that the library is trying to use the AgLeaderCalibration.dll behind the scenes, which I have the .dll . I've included it in the project in many ways. Referencing, copying it to output directory, etc., to no success.

I do not know C# that much. Maybe this is a very simple problem in the build process? Versioning?

Thanks in advance.

I've been in contact with CNH support people, and it turns out you need the Visual C++ Redistributable for Visual Studio 2012 installed: https://www.microsoft.com/en-us/download/details.aspx?id=30679 . Make sure you get the 32 bit version ( VSU_4\vcredist_x86.exe)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM