Trying to get MaestroAPI to work with MGOS 3.0

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Trying to get MaestroAPI to work with MGOS 3.0

Gunter Becker
Hi,

I've signed my MGOS 3.0 dll's and build a LocalNativeProvider from "MaestroSDK_6.0a3". I used it before for signing the 2.6 dll's. Since there were some API changes in MapGuide 3.0 I had to manually change the file "LocalNativeConnection.cs", but I'm not sure if this is the only file I have to change.

I got my application up and running except of one error that occurs when opening a runtime map:

IMappingService mapppingSvc = (IMappingService)Connection.GetService((int)ServiceType.Mapping);
runMap = mapppingSvc.OpenMap(mapId); // error
 
Message: Data in stream had type: ClassId but type 'Int32' was expected
Source: OSGeo.MapGuide.MaestroAPI
Type: System.InvalidCastException

Stack Trace:
bei OSGeo.MapGuide.MaestroAPI.Serialization.MgBinaryDeserializer.ReadInt32()
bei OSGeo.MapGuide.MaestroAPI.Mapping.RuntimeMap.Deserialize(MgBinaryDeserializer d)
bei OSGeo.MapGuide.MaestroAPI.PlatformConnectionBase.OpenMap(String runtimeMapResourceId)
 
Any idea how I can fix this or what could cause this problem?

Thanks, Gunter
Reply | Threaded
Open this post in threaded view
|

Re: Trying to get MaestroAPI to work with MGOS 3.0

Jackie Ng
This is a bug. MGOS 3.0 did introduce some changes to how the runtime binary state is saved that the LocalNativeConnection probably isn't aware of.

- Jackie
Reply | Threaded
Open this post in threaded view
|

Re: Trying to get MaestroAPI to work with MGOS 3.0

Gunter Becker
So, do you see any chance to fix this in the near future?

I make heavy use of the MaestroAPI in my applications and want our customers to use MGOS3.0 because of the new features introduced in this version (especially the "Enhanced Tile Service Support").

Gunter
Reply | Threaded
Open this post in threaded view
|

Re: Trying to get MaestroAPI to work with MGOS 3.0

Jackie Ng
Actually, the MaestorAPI was already MGOS 3.0 ready.

It's the migration to C# 6 / VS 2015 on trunk that broke the ProviderTemplate tool.

That should be fixed on trunk now.

- Jackie
Reply | Threaded
Open this post in threaded view
|

Re: Trying to get MaestroAPI to work with MGOS 3.0

Gunter Becker
Thanks Jackie.

I've already seen it in your commits and actually trying to get it to work in my application. Hopefully I can report any success soon.

Gunter
Reply | Threaded
Open this post in threaded view
|

Re: Trying to get MaestroAPI to work with MGOS 3.0

Gunter Becker
In reply to this post by Jackie Ng
Unfortunately there is an error when trying the new build of the LocalNativeProvider:

Could not load file or assembly 'OSGeo.MapGuide.MaestroAPI.Native-3.0.0' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I think the LocalNativeProvider dll is missing the PublicKeyToken of the MaestroAPI as you can see in this report from .NET Reflector:

// Assembly OSGeo.MapGuide.MaestroAPI.Native-3.0.0.dll, Version 0.0.0.0
Location: C:\Users\CSO\Documents\Visual Studio 2015\Projects\MapGuide3\MapGuide3\bin\OSGeo.MapGuide.MaestroAPI.Native-3.0.0.dll
Name: OSGeo.MapGuide.MaestroAPI.Native-3.0.0.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
Type: Library

Gunter