ThinkGeo.com    |     Documentation    |     Premium Support

Error running an app under mono/linux

We have a very simple console application to create shape file indexes. The application runs on a Linux system using mono.
I have upgraded this to ThinkGeo version 10. It is getting an error that appears to be related to the license file.
Here is the code for the app:

Imports ThinkGeo.MapSuite
Imports ThinkGeo.MapSuite.Layers
Module MapShapeIndex
    Sub Main(ByVal cmdArgs() As String)
         Dim sFileName As String
         sFileName = cmdArgs(0)
         ShapeFileFeatureLayer.BuildIndexFile(sFileName, BuildIndexMode.Rebuild,)
     End Sub
 End Module

Here is the error that appears:
mono MapShapeIndex.exe stop.shp

Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
at ThinkGeo.MapSuite.Portable.PclSystem.get_Directory () <0xa7a090 + 0x0003d> in :0
at ohM=.yhM=.1RM= (System.String licenseFileExtension, System.String searchPattern) <0xa78a98 + 0x000af> in :0
at ohM=.yhM=.zhM= () <0xa787f8 + 0x000d7> in :0
at ohM=.yhM=.0hM= () <0xa787d0 + 0x00017> in :0
at ohM=.XRQ=.YxQ= () <0xa773e8 + 0x0002b> in :0
at ohM=.XRQ=.YhQ= (System.Boolean needToShowProductCenter) <0xa76728 + 0x000a7> in :0
at ThinkGeo.MapSuite.ValidatorHelper.CheckStatus () <0xa76498 + 0x00013> in :0
at ThinkGeo.MapSuite.ValidatorHelper.CheckObjectIsNotNull (System.Object parameterObject, System.String parameterName) <0xa76358 + 0x0000b> in :0
at ThinkGeo.MapSuite.Layers.ShapeFileFeatureLayer.BuildIndexFile (System.String pathFilename, ThinkGeo.MapSuite.Layers.BuildIndexMode rebuildExistingIndexMode) <0xa762c8 + 0x0001b> in :0
at MapShapeIndex.MapShapeIndex.Main (System.String[] cmdArgs) <0xa6dfd8 + 0x00047> in :0
[ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
at ThinkGeo.MapSuite.Portable.PclSystem.get_Directory () <0xa7a090 + 0x0003d> in :0
at ohM=.yhM=.1RM= (System.String licenseFileExtension, System.String searchPattern) <0xa78a98 + 0x000af> in :0
at ohM=.yhM=.zhM= () <0xa787f8 + 0x000d7> in :0
at ohM=.yhM=.0hM= () <0xa787d0 + 0x00017> in :0
at ohM=.XRQ=.YxQ= () <0xa773e8 + 0x0002b> in :0
at ohM=.XRQ=.YhQ= (System.Boolean needToShowProductCenter) <0xa76728 + 0x000a7> in :0
at ThinkGeo.MapSuite.ValidatorHelper.CheckStatus () <0xa76498 + 0x00013> in :0
at ThinkGeo.MapSuite.ValidatorHelper.CheckObjectIsNotNull (System.Object parameterObject, System.String parameterName) <0xa76358 + 0x0000b> in :0
at ThinkGeo.MapSuite.Layers.ShapeFileFeatureLayer.BuildIndexFile (System.String pathFilename, ThinkGeo.MapSuite.Layers.BuildIndexMode rebuildExistingIndexMode) <0xa762c8 + 0x0001b> in :0
at MapShapeIndex.MapShapeIndex.Main (System.String[] cmdArgs) <0xa6dfd8 + 0x00047> in :0

Hi Marc,

Thanks for contacting ThinkGeo.

We created one sample to test rebuilding index function, it works fine.

Here attachment is our test sample, please download it and have a try on your device. If it works fine on your device, please check your packages is latest version in your project, if it is not latest version, please upgrade that to the latest version 10.1.0.
MapSuiteIndexBuilder.zip (98.7 KB)

If this issue still exists, please give us one sample with your test data. We can help to figure out this issue.

Thanks,
Mark

Hi Mark,
Yes, the application works fine when run from the Visual Studio development environment and on the Windows operating system. However, when I run it from the Linux operating system (RedHat 6) using mono, that is when it gets the error.

I have the latest package in my application. Also, an older version of the application created using ThinkGeo MapSuite version 8 works fine.
Please advise.

Hi Marc,

We had tested that in Ubuntu it works well.

We didn’t test that in RedHat, so our developer need more time to test it.

Any update we will let you know.

Regards,

Don

OK, I will watch for you response. Here is some additional information on the version of MONO we have tried:
We’ve tried Mono 4.5.2 and 5.2.0.215.
4.5.2 was compiled from source
5.2.0.215 was installed from the EPEL repository for CentOS

Hi Marc,

We don’t have a Redhat environment, but our developer had tested that based on the CentOS, it works well.

As below is our test result:
System: CentOS 7
Mono : Mono JIT compiler version 5.2.0.215

Regards,

Don