Opened 9 years ago

Closed 9 years ago

#2571 closed defect (fixed)

Maestro: Cannot build custom LocalNativeProvider

Reported by: gBecker Owned by: jng
Priority: high Milestone: Maestro-6.0
Component: Maestro Version: 3.0.0
Severity: major Keywords:
Cc: External ID:

Description

Hi Jackie,

I'm trying to build a custom LocalNativeProvider for the latest MapGuideOpenSource Version (3.0) using the LocalNativeProvider-Tool from Maestro (build from trunk). As you can guess: it doesn't work! The custom LocalNativeProvider isn't build!

First, the tool tries to sign the dll's located in the "MapGuide .net assemblies directory" wich works, except for the none existing MapGuideDotNetApi.dll. I do not think that this is the reason for not building the custom provider, cause this file doesn't already exists in former versions of MGOS.

I think the root cause is the the tool can't find a specific dll named "NetTopologySuite.Merged.dll". You can see it in the log:

Validating input parameters
.net Framework 4.0  directory found
MapGuide .net assemblies directory found
SDK binaries directory exists
Cleaned output directory: C:\Users\gunter.becker.CSO\Documents\Visual Studio 2015\Projects\MAESTRO\SDK\LocalNativeProvider\Bin
Cleaned lib directory: C:\Users\gunter.becker.CSO\Documents\Visual Studio 2015\Projects\MAESTRO\SDK\LocalNativeProvider\Lib\MapGuide
Copying MapGuide dlls to lib
Copied: C:\Program Files\OSGeo\MapGuide3.0\Web\www\mapviewernet\bin\ACE.dll
Copied: C:\Program Files\OSGeo\MapGuide3.0\Web\www\mapviewernet\bin\FoundationUnmanagedApi.dll
Copied: C:\Program Files\OSGeo\MapGuide3.0\Web\www\mapviewernet\bin\GeometryUnmanagedApi.dll
Copied: C:\Program Files\OSGeo\MapGuide3.0\Web\www\mapviewernet\bin\GEOS.dll
Copied: C:\Program Files\OSGeo\MapGuide3.0\Web\www\mapviewernet\bin\lib_json.dll
Copied: C:\Program Files\OSGeo\MapGuide3.0\Web\www\mapviewernet\bin\MapGuideCommonUnmanagedApi.dll
Copied: C:\Program Files\OSGeo\MapGuide3.0\Web\www\mapviewernet\bin\MgFoundation.dll
Copied: C:\Program Files\OSGeo\MapGuide3.0\Web\www\mapviewernet\bin\MgGeometry.dll
Copied: C:\Program Files\OSGeo\MapGuide3.0\Web\www\mapviewernet\bin\MgHttpHandler.dll
Copied: C:\Program Files\OSGeo\MapGuide3.0\Web\www\mapviewernet\bin\MgMapGuideCommon.dll
Copied: C:\Program Files\OSGeo\MapGuide3.0\Web\www\mapviewernet\bin\MgMdfModel.dll
Copied: C:\Program Files\OSGeo\MapGuide3.0\Web\www\mapviewernet\bin\MgMdfParser.dll
Copied: C:\Program Files\OSGeo\MapGuide3.0\Web\www\mapviewernet\bin\MgPlatformBase.dll
Copied: C:\Program Files\OSGeo\MapGuide3.0\Web\www\mapviewernet\bin\MgWebApp.dll
Copied: C:\Program Files\OSGeo\MapGuide3.0\Web\www\mapviewernet\bin\MgWebSupport.dll
Copied: C:\Program Files\OSGeo\MapGuide3.0\Web\www\mapviewernet\bin\OSGeo.MapGuide.Foundation.dll
Copied: C:\Program Files\OSGeo\MapGuide3.0\Web\www\mapviewernet\bin\OSGeo.MapGuide.Geometry.dll
Copied: C:\Program Files\OSGeo\MapGuide3.0\Web\www\mapviewernet\bin\OSGeo.MapGuide.MapGuideCommon.dll
Copied: C:\Program Files\OSGeo\MapGuide3.0\Web\www\mapviewernet\bin\OSGeo.MapGuide.PlatformBase.dll
Copied: C:\Program Files\OSGeo\MapGuide3.0\Web\www\mapviewernet\bin\OSGeo.MapGuide.Web.dll
Copied: C:\Program Files\OSGeo\MapGuide3.0\Web\www\mapviewernet\bin\PlatformBaseUnmanagedApi.dll
Copied: C:\Program Files\OSGeo\MapGuide3.0\Web\www\mapviewernet\bin\WebUnmanagedApi.dll
Copied: C:\Program Files\OSGeo\MapGuide3.0\Web\www\mapviewernet\bin\xerces-c_3_1mg.dll
Signing MapGuide assemblies
Target Framework: 2.0
Detecting tools...Done
Compiler: C:\Windows\Microsoft.NET\Framework64\v2.0.50727\ilasm.exe
Decompiler: C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\x64\ildasm.exe
Creating Backup folder...Done
Backing up original DLL files.
[WARNING]: Could not find file to backup (MapGuideDotNetApi.dll)
Copying OSGeo.MapGuide.Foundation.dll...Done
Copying OSGeo.MapGuide.Geometry.dll...Done
Copying OSGeo.MapGuide.MapGuideCommon.dll...Done
Copying OSGeo.MapGuide.PlatformBase.dll...Done
Copying OSGeo.MapGuide.Web.dll...Done
[WARNING]: Could not find file to decompilation (MapGuideDotNetApi.dll)
Decompiling: OSGeo.MapGuide.Foundation.dll...Done
Decompiling: OSGeo.MapGuide.Geometry.dll...Done
Decompiling: OSGeo.MapGuide.MapGuideCommon.dll...Done
Decompiling: OSGeo.MapGuide.PlatformBase.dll...Done
Decompiling: OSGeo.MapGuide.Web.dll...Done
Deleting MapGuideDotNetApi.dll...done
Deleting OSGeo.MapGuide.Foundation.dll...done
Deleting OSGeo.MapGuide.Geometry.dll...done
Deleting OSGeo.MapGuide.MapGuideCommon.dll...done
Deleting OSGeo.MapGuide.PlatformBase.dll...done
Deleting OSGeo.MapGuide.Web.dll...done
Fixing: OSGeo.MapGuide.Web.il
  Added key to section: .assembly extern /*23000002*/ osgeo.mapguide.foundation
  Added key to section: .assembly extern /*23000003*/ osgeo.mapguide.platformbase
  Added key to section: .assembly extern /*23000004*/ osgeo.mapguide.geometry
Compiling: OSGeo.MapGuide.Web.il...Done
Fixing: OSGeo.MapGuide.PlatformBase.il
  Added key to section: .assembly extern /*23000001*/ osgeo.mapguide.foundation
  Added key to section: .assembly extern /*23000004*/ osgeo.mapguide.geometry
Compiling: OSGeo.MapGuide.PlatformBase.il...Done
Fixing: OSGeo.MapGuide.MapGuideCommon.il
  Added key to section: .assembly extern /*23000002*/ osgeo.mapguide.foundation
  Added key to section: .assembly extern /*23000003*/ osgeo.mapguide.platformbase
  Added key to section: .assembly extern /*23000004*/ osgeo.mapguide.geometry
Compiling: OSGeo.MapGuide.MapGuideCommon.il...Done
Fixing: OSGeo.MapGuide.Geometry.il
  Added key to section: .assembly extern /*23000002*/ osgeo.mapguide.foundation
Compiling: OSGeo.MapGuide.Geometry.il...Done
Fixing: OSGeo.MapGuide.Foundation.il
Compiling: OSGeo.MapGuide.Foundation.il...Done
[WARNING]: Cannot find IL file to fix (MapGuideDotNetApi.il)
[WARNING]: No IL file to compile (MapGuideDotNetApi.il)
Cleanup...Done
All OSGeo files has been signed.

Write out AssemblyInfo.cs
http://xkcd.com/303/ - OSGeo.MapGuide.MaestroAPI.Native-3.0.0.dll
Microsoft (R) Visual C# Compiler version 4.6.0079.0

for C# 5
Copyright (C) Microsoft Corporation. All rights reserved.



This compiler is provided as part of the Microsoft (R) .NET Framework, but only supports language versions up to C# 5, which is no longer the latest version. For compilers that support newer versions of the C# programming language, see http://go.microsoft.com/fwlink/?LinkID=533240

error CS0006: Die Metadatendatei 'C:\Users\gunter.becker.CSO\Documents\Visual Studio 2015\Projects\MAESTRO\SDK\LocalNativeProvider\..\Bin\NetTopologySuite.Merged.dll' konnte nicht gefunden werden.

csc.exe returned 1
Build SUCCESS

Thanks, Gunter

Attachments (1)

Form1.cs.patch (754 bytes ) - added by gBecker 9 years ago.
Patch for ProviderTemplate

Download all attachments as: .zip

Change History (7)

comment:1 by jng, 9 years ago

Ah, in my process of NuGet-ifying as much of Maestro's external libraries, I forgot to update the LocalNativeProvider build tool to use the new expected assembly set.

comment:2 by jng, 9 years ago

OK this is a bit more complicated

because Maestro now targets C #6, the provider template tool cannot just shell out to CSC.exe to compile the provider assembly. We have to programmatically do this with the Roslyn APIs

comment:3 by jng, 9 years ago

Ok, you should be able to build the local native provider against MGOS 3.0 now on trunk.

comment:4 by gBecker, 9 years ago

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

by gBecker, 9 years ago

Attachment: Form1.cs.patch added

Patch for ProviderTemplate

comment:5 by gBecker, 9 years ago

I got it!

It wasn't the missing PublicKeyToken (maestroapi.key), but a wrong AssemblyName in ProviderTemplate. I fixed it in Code and created a patch.

comment:6 by jng, 9 years ago

Resolution: fixed
Status: newclosed

Fixed. Thanks for the patch.

Note: See TracTickets for help on using tickets.