theoldman73 / tf-net

Automatically exported from code.google.com/p/tf-net
0 stars 0 forks source link

Update the Topology.IO.MapGuide dll to reference MapGuide 2.0 #2

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The current binary in 1.0.8 references MapGuide 1.2.0.
This means I cannot pass objects from the MapGuide API into the reader,
which makes it pretty useless :).

I cannot find the code for the MapGuide reader/writer under SVN.
Is it not avalible, or can you point me to the right spot?

Great framework, btw. I'm using it in MaestroAPI (formely MapStudio OS
API), instead of my own half baked WKT reader/writer.

Original issue reported on code.google.com by kenneth....@gmail.com on 12 May 2008 at 5:08

GoogleCodeExporter commented 8 years ago
Hi Kenneth,

Thanks :-) I'm just preparing a major repository reorganization and v1.0.9. 
Also 
added: OGR Reader (for GDAL/OGR geometries). Problem with MapGuide will also 
get 
solved. 

BTW, is there a problem with MgReader/MgWriter referencing MGE 1.2.0 libraries? 
I 
thought that namespacing between Autodesk and OSGeo didn't change, so it should 
be 
backward compatible. I didn't switch to MGOS 2.0 yet, still waiting for 2.0.1 
and 
stability fixes.

Original comment by LivelyTe...@gmail.com on 14 May 2008 at 9:54

GoogleCodeExporter commented 8 years ago
If I try to do:
{{{
OSGeo.MapGuide.MgFeatureReader reader = null;
Topology.IO.MapGuide.MgReader m_mgReader = new Topology.IO.MapGuide.MgReader();
m_mgReader.ReadGeometry(ref reader, "Geometry");
}}}

I get the following compile output:
{{{
FeatureSetReader.cs(275,25): error CS0012: The type 
'OSGeo.MapGuide.MgFeatureReader'
is defined in an assembly that is not referenced. You must add a reference to
assembly 'MapGuideDotNetApi, Version=1.2.0.4103, Culture=neutral,
PublicKeyToken=6416a18f8953383b'.
Topology.IO.MapGuide.dll: (Related file)
FeatureSetReader.cs(275,44): error CS1502: The best overloaded method match for
'Topology.IO.MapGuide.MgReader.ReadGeometry(ref OSGeo.MapGuide.MgFeatureReader,
string)' has some invalid arguments
FeatureSetReader.cs(275,75): error CS1503: Argument '1': cannot convert from 
'ref
OSGeo.MapGuide.MgFeatureReader [MapGuideDotNetApi.dll]' to 'ref
OSGeo.MapGuide.MgFeatureReader []'
}}}
So it appears that it is looking at the version attributes, and determined that 
they
are not matching.

The publickey-token is something I have added with 
[http://www.codeplex.com/Signer
Signer], because of [https://trac.osgeo.org/mapguide/ticket/552 MapGuide bug 
#552].

Original comment by kenneth....@gmail.com on 14 May 2008 at 12:02

GoogleCodeExporter commented 8 years ago
Kenneth, did you also added a reference to MapGuideDotNetApi.dll from MGOS 2.0 
to 
your project referencing TF.NET libraries? BTW, is there still 
MapGuideDotNetApi.dll 
managed wrapper in MGOS 2.0?

Original comment by LivelyTe...@gmail.com on 14 May 2008 at 3:28

GoogleCodeExporter commented 8 years ago
I mean - you probably did that :-) There's obviously a change at:

FeatureSetReader.cs(275,44): error CS1502: The best overloaded method match for
'Topology.IO.MapGuide.MgReader.ReadGeometry(ref OSGeo.MapGuide.MgFeatureReader,
string)' has some invalid arguments

It's either a change in MGOS SWIG interfaces or just a simple mistake - I see 
no 
purpose of MGOS 2.0 breaking backward compatibility in such a way (overloading 
parameters works just fine). Weird.

Original comment by LivelyTe...@gmail.com on 14 May 2008 at 4:12

GoogleCodeExporter commented 8 years ago
I have added only the Dll, for MGOS 2.0. I think .Net expects my project to 
reference
MapGuideDotNetApi.dll with version attributes 1.2.0 (You must add a reference to
assembly 'MapGuideDotNetApi, Version=1.2.0.4103).

There exists an MgFeatureReader in my project, but it is not of the 1.2.0 type:
Argument '1': cannot convert from 'ref
OSGeo.MapGuide.MgFeatureReader [MapGuideDotNetApi.dll]' to 'ref
OSGeo.MapGuide.MgFeatureReader []'

The first instance is for 2.0.0 (referenced), the second for 1.2.0 (not 
refrenced).

I don't think there's any change in the interface. I have attached the Dll, if 
you
want to try it out.

Original comment by kenneth....@gmail.com on 14 May 2008 at 4:36

Attachments:

GoogleCodeExporter commented 8 years ago
Actually, I have been referencing Autodesk MapGuide Enterprise 2007 managed 
wrapper -
 maybe there's a catch. BTW, Readers/Writers do not target specific library version, 
so if package was built using a lower version libs it should work on 2.0.0. 
It's not 
just versioning, there's something else going on...

Original comment by LivelyTe...@gmail.com on 15 May 2008 at 2:09

GoogleCodeExporter commented 8 years ago
The dll shipped with MGOS 2.0 is not signed. I signed it with the Signer tool,
perhaps that is the problem? The 1.2.0 appears to be signed, but obviously with
another key.

Original comment by kenneth....@gmail.com on 15 May 2008 at 8:39

GoogleCodeExporter commented 8 years ago
Weird. I just tried recompiling the MgReader/Writer with the 
MapGuideDotNetApi.dll 
you attached, and everything went fine. Kenneth, did MgReader/Writer actually 
work 
on previous version of MGOS? I'm asking this because it's not tested, at least 
not 
by me.

Please take a look in the Trunk, I reorganized things a bit and it should be 
easier 
to build TF.NET from code now - there's also a short guide on it in Wiki pages.

Original comment by LivelyTe...@gmail.com on 16 May 2008 at 11:07