ThinkGeo.com    |     Documentation    |     Premium Support

Deployment Thinkgeo V10 on client machine

Hi,

We migrate our application with the version thinkgeo 10 (before we were in version 8)

I have some questions regarding the deployment of these new dlls on a client workstation.

  1. How to deploy unmanaged dll on the client machine? (like ThinkGeo.MapSuite.Wrappers.MrSidX64.dll for example)

  2. In v8, we generated the application and could deploy the application directly on the client machine.
    According to the link http://wiki.thinkgeo.com/wiki/map_suite_runtime_license_guide_for_desktop, the deployment mode is different now.
    You have to register the application first, right?
    If we do not do, we have this kind of error on the client computer? "Can not acquire the required permissions" System.Security.Policy.PolicyExceptions) ;-(

  3. Can we still create and deploy as many applications as we want? Or is there a limit today?

Thanks.

Regards.

Steph.

Hi Steph,

Thanks for let us know your questions, our V10 use the file license mode and put all package on Nuget, so some things changed. As below is the reply about your questions:

  1. We move almost all the dlls into application folder, so you don’t need handle unmanaged dll again now. Only the 4 merge modules maybe needed for your scenario, you can find them at the end of http://wiki.thinkgeo.com/wiki/map_suite_runtime_license_guide_for_desktop

  2. In V10 you need generate the license file based on your application .exe, and the license file need be placed in the same folder with your application file. The guide:http://wiki.thinkgeo.com/wiki/map_suite_runtime_license_guide_for_desktop shows how to generate the license file, please login your product center and operate that, the license file don’t contains any information about your ID, it just related with the execute file.

  3. We still don’t have limitation about the number, please feel free to use it.

Wish that’s helpful.

Regards,

Ethan

Hi Ethan,

Thanks for your help.

I have some deployment issues on a client machine.
I describe below the various problems I encountered

  1. When I launch our application, I have an error message telling me that it is missing 2 dlls (msvcr120d.dll et msvcp120d.dll).
    I have this message regardless of the debug or release build mode.
    To overcome this problem, I recovered these dlls and I copy them among the deployment dlls of our application.
    The error message no longer appears.

However, I have another problem with raster jp2.
When I launch the application, I have the following error.

Message : La valeur ne peut pas être null.
Nom du paramètre : ptr
Source : mscorlib
Module : mscorlib.dll
Exception : System.ArgumentNullException: La valeur ne peut pas être null.
Nom du paramètre : ptr
à System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointer(IntPtr ptr, Type t)
à ohM=.iEc=.Q0c=()
à ohM=.h0c=.eyQ=(String fileName)
à ThinkGeo.MapSuite.Layers.Jpeg2000RasterSource.OpenCore()
à ThinkGeo.MapSuite.Layers.RasterSource.Open()
à ThinkGeo.MapSuite.Layers.Layer.Open()
à Workspaces.Cartographie.Layers.MultiGeoRasterLayer.BuildReferenceFile(String newReferencepathFileName, String pathOfRasterFiles, Boolean inclureSousRépertoires) dans C:\Steph_TFSMain\Projets Vegetal\Workspaces\Cartographie\Workspaces.Cartographie\Layers\MultiGeoRasterLayer.cs:ligne 202

Loaded assemblies:
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Divers.Portail.UI, Version=3.0.0.20978, Culture=neutral, PublicKeyToken=null
PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

The corresponding code in the class MultiGeoRasterLayer is : (in bold).

            using (var streamWriter = File.CreateText(newReferencepathFileName))
            {

                foreach (var file in files)
                {

                    var rasterRasterLayer = CreateLayer(file);

                    if (rasterRasterLayer != null)
                    {
                        try
                        {
                            if (NomLayer!=null) rasterRasterLayer.Name = NomLayer;
                            **if (!rasterRasterLayer.IsOpen) rasterRasterLayer.Open();**
                            var boundingBox = rasterRasterLayer.GetBoundingBox();
                            rasterRasterLayer.Close();
                            streamWriter.WriteLine(
                                $"{boundingBox.UpperLeftPoint.X.ToString(CultureInfo.InvariantCulture)};{boundingBox.LowerRightPoint.X.ToString(CultureInfo.InvariantCulture)};{boundingBox.UpperLeftPoint.Y.ToString(CultureInfo.InvariantCulture)};{boundingBox.LowerRightPoint.Y.ToString(CultureInfo.InvariantCulture)};{file}");

                        }
                        catch (Exception ex)
                        {
                            Trace.TraceException(ex);
                            Trace.TraceInfo("Raster défectueux : {0}", file);
                        }
                        finally
                        {

                        }
                    }

                }

            }
        }

When I use .tif rasters, I have no problem, I can see the raster in our application.

Do you know where the problem may come from?

Thanks .

Regards.

Steph.

Hi Steph,

The msvcr120d.dll and msvcp120d.dll we hadn’t provided them for now, but we will package them in plan. Please just copy them and zip them.

Does jp2 cannot be opened in both development machine and deployment machine? If that only appear in deployment machine, please make sure all dlls in your debug folder had been copied.

If that’s appear in both machine, please make sure this package is installed: https://www.nuget.org/packages/ThinkGeo.MapSuite.Layers.Jpeg2000/11.0.0-beta008, for your exception we think that’s should related with the data. Could you please upload the data to us, so our developer can work on it? If it’s big please upload to our FTP, contact your sales can get your account.

Regards,

Ethan

We have exactly the same error with jp2, but with WinForms and only on the deployment machine. It seems to me we have to deploy an additional dll, but which one and where ? The “Release” dir executed on the dev machine work well. The same “Release” dir copied to a deployment machine gives me an error.

Hi Judicael_ribault,

Only copy release folder shouldn’t enough for some special layers, because when you install the package from Nuget, our script will run and copy some dlls into your system folder.

Please refer this reply and see whether the solution is helpful for your scenario: V10 - MrSidRasterLayer & Jpeg2000RasterLayer - Exceptions

Regards,

Ethan

Ok so we try to build a setup using IS, we package modules MicrosoftSqlServerTypes and MicrosoftVisualCRunTime100 as described at the end of the page http://wiki.thinkgeo.com/wiki/map_suite_runtime_license_guide_for_desktop, but we still have the same error, only on deployment machines.

Do I miss something ?

Hi Judicael_ribault,

It looks the msm need to get updated.

You can try to copy the 4 dlls now to solve that and we will update the msm file some days later.

msvcp120.dll
msvcp120d.dll
msvcr120.dll
msvcr120d.dll

Regards,

Ethan

Hi Judicael_ribault,

Our developer had updated the package, please download it again and test that.

http://wiki.thinkgeo.com/wiki/map_suite_runtime_license_guide_for_desktop#deploying_applications

Regards,

Ethan

Hi Ethan,

I have questions about .msm file …
This file contains the dlls unmanaged , thats 'it ?
How to extract the dlls from this msm file ?
How to install a msm file on a client PC ?

Thanks

Regards.
Steph.

Hi Judicael_ribault,

.msm is for “merge module”.

  1. Unmanaged dlls is the C++ dlls, most of them is the 3rd part library
  2. The msm don’s support unzip, it had been integrated into the installer file (.msi or .exe)
  3. You can run the installer file in client PC

You should want query about “Merge Module” to get more detail information.

Regards,

Ethan

Hi Ethan, 

Thanks for your help.

On some of our customers' posts, there is an error message like this:
*System.BadImageFormatException: Tentative de chargement d’un programme de format incorrect. (Exception de HRESULT : 0x8007000B)*

à Microsoft.SqlServer.Types.GLNativeMethods.SetClrFeatureSwitchMap(Int32 clrFeatureSwitchMap)
à Microsoft.SqlServer.Types.SqlGeometry.IsValidExpensive()
à Microsoft.SqlServer.Types.SqlGeometry.Construct(GeoData g, Int32 srid)
à Microsoft.SqlServer.Types.SqlGeometry.GeometryFromText(OpenGisType type, SqlChars text, Int32 srid)

This kind of message appears when there is a conflict problem between x86 and x64 dlls.
So I used ProcessMonitor on my post ((I do not have this problem on my pc) and try to understand the calls of the dlls.

I have a Windows 10 x64 machine, an express sql server 2014 in x64.

With ProcessMonitor, I see that the called Microsoft.SqlServer.Types dll is the one in the GAC.

IRP_MJ_CREATE C:\Windows\assembly\GAC_MSIL\Microsoft.SqlServer.Types\14.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.Types.dll SUCCESS Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened

With ProcessMonitor, I see that the called SqlServerSpatial140.dll dll is the one that is in c: \ Windows \ System32.
*IRP_MJ_CREATE	C:\Windows\System32\SqlServerSpatial140.dll	SUCCESS	Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened*

Our application is running in x64 mode (the methods return true for Environment.Is64BitOperatingSystem and Environment.Is64BitProcess)

**How is it that everything is in x64 but the called SqlserverSpatial140 dll is the one in c: \ Windows \ System32 (so x86) ?**

Another question: Can Microsoft.SqlServer.Types.dll be used with any version of sql server installed on a computer?**

An attached file, there is a screen shot of the version number of Microsoft.SqlServer.Types.dll used in our application.

**

The version of thinkgeo used is MapSuiteDesktopForWpf-Standard 10.2.4.

Thanks.

Regards.

Steph.

Hi Steph,

Thanks for your information.

The Microsoft.SqlServer.Types.dll should be included in our package MapSuiteDependency-MicrosoftSqlServerTypes.10.2.1, if you found that’s in GAC, please check the package to see whether it’s downloaded or referenced correct.

And the version should be just the same as our latest version.

About the possible conflict between x86 and x64, I think that’s still be related with the environment setting of IDE, and I guess you can try to make sure whether the WOW64 folder contains the target dll, in some case if the wow64 folder don’t contains the dll, some 3rd part library maybe try to found it in system32 folder.

And we want to know some of your code to see why this function is called.

Any news please let us know.

Regards,

Ethan