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