[mapguide-users] Application compatibility b/w MGE2009 and MGOS 2.0.2

Kenneth Skovhede, GEOGRAF A/S ks at geograf.dk
Fri Jan 15 07:17:54 EST 2010


You need to run it with corflags.exe and ildasm.exe in the path.
The easiest way to do this is to use the "Visual Studio 200x Command Prompt"

Regards, Kenneth Skovhede, GEOGRAF A/S

On 15-01-2010 10:48, Dejan Gregor wrote:
> I have tried to run it, but I got following error :
>
> Execute of corflags.exe  failed
>
> Execute of ildasm.exe /? failed
> An unexpected processing error did occur: 
> System.NullReferenceException: Object
> reference not set to an instance of an object.
>    at Signer.Executor.GetInvalidCommands()
>    at Signer.Program.Execute()
>    at Signer.Program.Main(String[] args)
>
> I will wait your information. Thanks!
> Dejan
>
> On Fri, Jan 15, 2010 at 10:13, Kenneth Skovhede, GEOGRAF A/S [via 
> OSGeo.org] <[hidden email] 
> <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=4397794&i=0>> 
> wrote:
>
>     You only need an updated MapGuideDotNetApi if you are using the
>     LocalNativeConnection.
>     I will upload the updated signed dll files later today (appx 20:00
>     GMT)
>
>     If you cannot wait, the command to sign MapGuideDotNetApi is:
>     signer.exe -k maestroapi.key -outdir .\out -a MapGuideDotNetApi.dll
>
>     Signer.exe and the key is in SVN:
>     http://trac.osgeo.org/mapguide/browser/trunk/Tools/Maestro/MaestroAPI/Signer/Signer.exe?format=raw
>     http://trac.osgeo.org/mapguide/browser/trunk/Tools/Maestro/MaestroAPI/maestroapi.key?format=raw
>
>     The bindingRedirect setup is as follows:
>     <?xml version="1.0"?>
>     <configuration>
>     <runtime>
>     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
>     <dependentAssembly>
>     <assemblyIdentity name="MapGuideDotNetApi"
>     publicKeyToken="f526c48929fda856" />
>
>     <!--
>                      NOTE: href MUST be absolute, alternative is to
>     just rename
>                      the desired version of the file and replace
>     MapGuideDotNetApi.dll
>
>                      If you choose the rename option, remove the
>     <codeBase>
>     tags below,
>                      but keep the <bindingRedirect>
>                  -->
>     <codeBase version="1.2.0.4103" href="MapGuideDotNetApi-1.2.dll"/>
>     <codeBase version="2.0.0.2308" href="MapGuideDotNetApi-2.0.dll"/>
>     <codeBase version="1.0.0.1" href="MapGuideDotNetApi-2.1.dll"/>
>
>     <!-- Activate MGOS 1.2, MGEP 2008 -->
>     <!-- <bindingRedirect oldVersion="2.0.0.2308"
>     newVersion="1.2.0.4103" /> -->
>
>     <!-- Activate MGOS 2.0, MGEP 2009 , *default* -->
>     <!-- <bindingRedirect oldVersion="2.0.0.2308"
>     newVersion="2.0.0.2308" /> -->
>
>     <!-- Activate MGOS 2.1, MGEP 2010 -->
>     <bindingRedirect oldVersion="2.0.0.2308" newVersion="1.0.0.1" />
>
>     </dependentAssembly>
>     </assemblyBinding>
>     </runtime>
>     </configuration>
>
>     Regards, Kenneth Skovhede, GEOGRAF A/S
>
>     On 15-01-2010 09:41, Dejan Gregor wrote:
>
>     > Kenneth,
>     >
>     > I am using the verion 2.1.0.3505 for MapGuideDotNetApi. Where
>     should I set
>     > the version value (newVersion or oldVersion) and is the
>     publicKeyToken still
>     > 'f526c48929fda856'?
>     >
>     > I am using MGE 2010.
>     >
>     > Dejan
>     >
>     >
>     >
>     > Kenneth Skovhede, GEOGRAF A/S wrote:
>     >
>     >> The "Invalid Stream Header" is a sort-of catch-all exception
>     that happens
>     >> when the MapGuide service tries to de-serialize an object, and
>     finds
>     >> something it does not expect.
>     >> The usual cause of this is the other (unmanaged) binaries.
>     >>
>     >> The MapGuideDotNet.dll file is a thin wrapper that just calls the
>     >> unmanaged dll's.
>     >>
>     >> So you can bind .Net to either version of the managed dll, but
>     you MUST
>     >> have the correct
>     >> unmanaged dll's in the bin folder.
>     >>
>     >> Alternatively, you can fix the binding through the Web.config
>     file:
>     >> <configuration>
>     >> <runtime>
>     >> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
>     >> <dependentAssembly>
>     >> <assemblyIdentity name="MapGuideDotNetApi"
>     >> publicKeyToken="f526c48929fda856" />
>     >> <bindingRedirect oldVersion="2.0.0.2308" newVersion="1.2.0.4103"
>     >> />
>     >> </dependentAssembly>
>     >> </assemblyBinding>
>     >> </runtime>
>     >> </configuration>
>     >>
>     >> Replace the publicKeyToken and version as you please.
>     >>
>     >> There was a slight change with MgDisposable/MgGuardedDisposable
>     some
>     >> time ago.
>     >> If you run into that, you have to use the re-bind option
>     described above.
>     >>
>     >> Regards, Kenneth Skovhede, GEOGRAF A/S
>     >>
>     >>
>     >>
>     >> MacNair skrev:
>     >>
>     >>> We have a Mapguide application developed using MGE 2009’s
>     library.  This
>     >>> application does most of its work by calling methods from
>     another DLL
>     >>> called
>     >>> “MGEUtils.DLL”. This DLL references “MapGuideDotNet.DLL”.
>     >>>
>     >>> The application works fine on the development machine where
>     MGE is
>     >>> installed. But on the deployment machine where MapGuide Open
>     Source (MGOS
>     >>> 2.0.2.3011) is installed we are getting a few errors.
>     >>>
>     >>> Should we recompile the class library “MGEUtils” referencing
>     MGOS’s
>     >>> MapGuideDotNet.DLL?
>     >>>
>     >>> The calls made to the methods in MGEUtils to initialize the
>     application
>     >>> are
>     >>> throwing a few errors as given under. Note: The function
>     definitions for
>     >>> these methods are given in Appendix below:
>     >>>
>     >>> // Initialize the webtier
>     >>> string sErrMsg = "";
>     >>> mgeUtils.InitializeWebTier(configPath, sErrMsg);
>     >>>
>     >>> // Validate the user login and create a session
>     >>> mgeUtils.InitialiseSession("Anonymous", "", ref sessionId, ref
>     sErrMsg);
>     >>>
>     >>> Note:  The function definitions for the above calls within
>     MGEUtils are
>     >>> given at the end of this document.
>     >>>
>     >>> Errors encounterd are…
>     >>>
>     >>> CASE I: Placing MGE’s MapGuideDotNet.dll  along with
>     “MGEUtils.DLL”  in
>     >>> the
>     >>> application’s bin directory.
>     >>> Error @ LINE: mgeUtils.InitialiseSession("Anonymous", "", ref
>     sessionId,
>     >>> ref
>     >>> sErrMsg);
>     >>> Error details: OSGeo.MapGuide.MgInvalidStreamHeaderException:
>     Invalid
>     >>> stream
>     >>> header exception
>     >>>
>     >>> CASE II: Placing MGOS ’s MapGuideDotNet.dll  along with
>     “MGEUtils.DLL”
>     >>> in
>     >>> the application’s bin directory.
>     >>> Error @ LINE: mgeUtils.InitializeWebTier(configPath, sErrMsg);
>     >>> Error details: Could not load file or assembly
>     'MapGuideDotNetApi,
>     >>> Version=2.0.0.3202, Culture=neutral,
>     PublicKeyToken=6416a18f8953383b' or
>     >>> one
>     >>> of its dependencies. The located assembly's manifest
>     definition does not
>     >>> match the assembly reference. (Exception from HRESULT:
>     0x80131040)
>     >>>
>     >>> Any help on this? Sorry for the lengthy mail. Thanks!
>     >>>
>     >>> Function defintions
>     >>>
>     >>> public bool InitializeWebTier(string configPath, string csErrMsg)
>     >>> {
>     >>>     try
>     >>>     {
>     >>>       // Check if the webConfig file exists
>     >>>       if (!File.Exists(configPath)) { return false; }
>     >>>
>     >>>       MapGuideApi.MgInitializeWebTier(configPath);
>     >>> return true;
>     >>>      }
>     >>>      catch (MgConnectionFailedException mge)
>     >>>      {
>     >>> csErrMsg = mge.GetMessage();
>     >>> return false;
>     >>>      }
>     >>> }
>     >>> public bool InitialiseSession(string userName, string userPwd,
>     ref string
>     >>> sessionId, ref string csErrMsg)
>     >>> {
>     >>>    try
>     >>>    {
>     >>>     // Validate user login
>     >>>     MgUserInformation userInfo = new
>     MgUserInformation(userName, userPwd);
>     >>>     MgSite site = new MgSite();
>     >>>     site.Open(userInfo);
>     >>>
>     >>>     // Create a session
>     >>>     sessionId = site.CreateSession();
>     >>>    }
>     >>>    catch (MgConnectionFailedException mge)
>     >>>    {
>     >>>     csErrMsg = mge.GetMessage();
>     >>>     return false;
>     >>>    }
>     >>>
>     >>>    return true;
>     >>> }
>     >>>
>     >>>
>     >>>
>     >>>
>     >>>
>     >> _______________________________________________
>     >> mapguide-users mailing list
>     >> [hidden email]
>     <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=4397661&i=0>
>     >> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>
>     >>
>     >>
>     >>
>     >
>     > -----
>     >
>     > Dejan Gregor, MSc
>     > GISc Researcher and Consultant
>     >
>     > http://www.linkedin.com/in/dgregor
>     >
>     _______________________________________________
>     mapguide-users mailing list
>     [hidden email]
>     <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=4397661&i=1>
>     http://lists.osgeo.org/mailman/listinfo/mapguide-users
>
>
>
> Dejan Gregor, MSc
> GISc Researcher and Consultant
>
> http://www.linkedin.com/in/dgregor
>
> ------------------------------------------------------------------------
> View this message in context: Re: [mapguide-users] Application 
> compatibility b/w MGE2009 and MGOS 2.0.2 
> <http://n2.nabble.com/Application-compatibility-b-w-MGE2009-and-MGOS-2-0-2-tp1819071p4397794.html>
> Sent from the MapGuide Users mailing list archive 
> <http://n2.nabble.com/MapGuide-Users-f1803227.html> at Nabble.com.
>
>
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>    
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20100115/91a16613/attachment.html


More information about the mapguide-users mailing list