I am developing an R package which uses C++ DLLS (in the package lib directory). I have done this before successfully, and the DLLs are called and loaded fine from R calls via Rcpp. Now one of my DLLs (ExcelInterface) calls functions in a C# interop DLL - Microsoft.Office.Interop.Excel - and I get the error:
Could not load file or assembly 'ExcelInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies
I have created a C++ exe on my desktop which calls exactly the same functions as my R code, and has the same DLLs locally as my R package, and that runs fine without the error.
(I get the same error with the R code if I build ExcelInterface with embedded C# interop types.)
I expected the C++ app and the R package to be subject to the same system environment, and so have the same behaviour.
Can anyone assist with the required magic to solve this issue.
Thanks