As I remember, LoadLibrary can be vague when reporting its failures. For instance reporting exactly why some DLL can not be loaded; typically because a 64 bit process loads a 32 bit DLL or vice and versa. Another common issue is when another DLL depended
upon is not found (e.g. RBlas.dll in the case of stats.dll)
That is the background; practical things I suggest:
1 - Diagnosing and Reporting the environment variable process
Have a look at
in the solution file under solutions/Onboard you'll find a sample app ReportInfo that retrieves the log of R.NET engine setup, and you may use this to diagnose and report information in your application.
2 - ASP.NET known issues.
you do not mention you are diagnosing from ASP.NET (I think you should first use a working console application to prototype your application). Mixing ASP.NET and R.NET has known peculiarities for environment variables. You would have found some discussions
on this site with advice on how to set things up for instance
the recent posts in this thread