Closed ericbmartin closed 7 years ago
0.7 is built against VC13 Redistrib. Can you make sure that's installed? Or try v1.0.0-beta, which is built against VC15. You use the modules view in VS to see what binaries are getting loaded locally and then compare that to your sever. Does the C:/Apps setup work on your dev machine?
You can also use ProcMon to see what modules it's trying and to load and which ones fail.
Thanks Eric, I was having some trouble initially getting the GribAPI.dll to load in my development environment, so I set the location VIA code (Environment.SetEnvironmentVariable("GRIB_API_DIR_ROOT", @"C:\Apps");) and that worked, but the same setup was not working on the server. The ProcMon suggestion was helpful - It showed that the system could not find the "C:\Windows\System32\msvcr120.dll" file (among other places it checked), which a Google search revealed that this is indeed the 2013 VC Redist (https://www.microsoft.com/en-gb/download/details.aspx?id=40784) where I had the 2015 version installed. Once I uninstalled VC2015 installed VC2013 on the server, it was able to find the supporting DLLs.
I'm not sure if I had inadvertently installed VC2013 in my dev environment or is was there from a previous version of Visual Studio, but it does show up in Installed Programs, so that is why it worked in the dev environment.
Glad ProcMon helped. It's a powerful debugging tool.
Is everything working for you now?
Yes, I am able to read the GRIB files now, the key was getting the right VC distribution.
Thanks!
Hello, I have been successful at building and running an application that uses GribApi.NET from my workstation with Visual Studio 2015 and using nugget for the GribApi.NET package, however, I am having issues deploying that application to a server machine.
I have set the GRIB_API_ENVIRONMENT variable to C:\Apps and the file "C:\Apps\Grib.Api\lib\win\x64\Grib.Api.Native.dll" does exist at that location. I installed the vc_redist.x64 and vc_redist.x86 (VS 2015 Redist, I believe) on the target server (Windows Server 2016), but I still get the error below. I suspect there is some dependent DLL that is not found when the application runs. Is there a document that describes install pre-reqs and how to deploy/install an application to a non-development machine?
System.TypeInitializationException: The type initializer for 'Grib.Api.GribFile' threw an exception. ---> System.Exception: Can't load DLL C:\Apps\Grib.Api\lib\win\x64\Grib.Api.Native.dll ---> System.ComponentModel.Win32Exception: The specified module could not be found --- End of inner exception stack trace --- at Grib.Api.Interop.Util.Win32.LoadWin32Library(String libPath) in c:\Users\eric\GribApi.NET\src\GribApi.NET\Grib.Api\Interop\Util\Win32.cs:line 36 at Grib.Api.GribEnvironmentLoadHelper.BootStrapLibrary() in c:\Users\eric\GribApi.NET\src\GribApi.NET\Grib.Api\GribEnvironmentLoadHelper.cs:line 17 at Grib.Api.GribEnvironment.Init() in c:\Users\eric\GribApi.NET\src\GribApi.NET\Grib.Api\GribEnvironment.cs:line 66 at Grib.Api.GribFile..cctor() in c:\Users\eric\GribApi.NET\src\GribApi.NET\Grib.Api\GribFile.cs:line 46 --- End of inner exception stack trace --- at Grib.Api.GribFile..ctor(String fileName)