LoadLibrary fails

May 21 2019 11:57 PM
I am tying to create WebApp (using Asp.Net Core 2.2) for existing desktop app which is written in C++. From my webapp I am trying to invoke the process. Inside the c++ exe it is trying to load some DLL which is failing in my case. Same thing is working fine when i directly invoke the desktop app from cmd.
 
Please suggest how to rectify this problem.
 
This is my webapp code where i am invoking the exe -
  1. ProcessStartInfo sprbProcessInfo = new ProcessStartInfo();  
  2. sprbProcessInfo.FileName = @"C:\Program Files\SmartPlant\Interop Publisher\SPRB.exe";  
  3. sprbProcessInfo.Arguments = "\"" + strSrcFileFullPath + "\"" + " -b " + "\"" + strDestFileFullPath + "\"";  
  4. sprbProcessInfo.RedirectStandardOutput = true;  
  5. sprbProcessInfo.UseShellExecute = false;  
  6. Process oTranslateProcess = new Process();  
  7. oTranslateProcess.StartInfo = sprbProcessInfo;  
  8. oTranslateProcess.Start();  
  9. oTranslateProcess.WaitForExit();  
  10. oTranslateProcess.Close();  
This is what I am trying to do in my exe -
 
LoadLibrary (csSolidsFile); ===> this call is failing 

Answers (1)