Changes between Initial Version and Version 1 of maestro/MaestroAPI/MapGuideDotNetApiVersions


Ignore:
Timestamp:
01/15/10 13:09:05 (15 years ago)
Author:
ksgeograf
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • maestro/MaestroAPI/MapGuideDotNetApiVersions

    v1 v1  
     1
     2== MaestroAPI and !MapGuideDotNetApi with !LocalNative connections ==
     3This document describes how to use the !MapGuideDotNetApi with [wiki:maestro MapGuide Maestro] API.
     4
     5== Why all the trouble ==
     6The MaestroAPI is signed with a !StrongName key, so you can use it in both strong name signed applications as well as non-signed applications.
     7
     8If you use the !LocalNative connection, Maestro uses the !MapGuide binaries to connect to !MapGuide.
     9Each version of !MapGuide has a new version of the !MapGuideDotNetApi, which is often not signed, and usually
     10changes version numbers.
     11
     12This makes it difficult to use with MaestroAPI, as it is compiled with a reference to a signed !MapGuideDotNetApi.
     13
     14== What to do ==
     15To work with another version than the one MaestroAPI was compiled for, you need a signed version of the !MapGuideDotNetApi and a bindingRedirect.
     16
     17
     18== How to obtain the signed version of !MapGuideDotNetApi ==
     19If you are targeting a main release of !MapGuide, there may be a ready made !MapGuideDotNetApi.dll here:
     20[http://trac.osgeo.org/mapguide/browser/trunk/Tools/Maestro/MaestroAPI/Signer/SignedVersions]
     21
     22If you the version you need is not listed, you can sign the one you have, using this commandline:
     23{{{
     24signer.exe -k maestroapi.key -outdir .\out -a MapGuideDotNetApi.dll
     25}}}
     26
     27The maestroapi.key is also avalible from the above link.
     28
     29Signer.exe is from the [http://www.codeplex.com/Signer Signer project].
     30
     31If your !MapGuideDotNetApi.dll is already signed, you need to play tricks with Signer, or simply build the dll from the !MapGuide source.
     32
     33== How to use bindingRedirect ==
     34As MaestroAPI is compiled with a reference to a certain version of !MapGuideDotNetApi, you cannot just update the dll.
     35
     36Microsoft MSDN has a description of [http://msdn.microsoft.com/en-us/library/7wd6ex19%28VS.80%29.aspx the problem and solution].
     37
     38Basically you place a configuration file with the same name as your executable.
     39For web applications, the file must be named web.config.
     40Example:
     41{{{
     42MyApplication.exe
     43MyApplication.exe.configuration
     44}}}
     45
     46There is a sample config file with the [http://trac.osgeo.org/mapguide/browser/trunk/Tools/Maestro/MaestroAPI/Signer/SignedVersions pre-signed dll's]
     47
     48You simply add a <bindingRedirect> xml element stating the new version to bind to, eg:
     49{{{
     50<bindingRedirect oldVersion="2.0.0.2308" newVersion="1.0.0.1" />
     51}}}
     52
     53You can then replace the !MapGuideDotNetApi dll with the one with the new version number.
     54
     55An optional step is to also point to the correct file. You must do this is the new file is not named !MapGuideDotNetApi.dll:
     56{{{
     57<codeBase version="1.0.0.1" href="C:\MapGuideDotNetApi-2.1.dll"/>
     58}}}
     59
     60Unfortunately the href path must be absolute.