[mapguide-users] Application compatibility b/w MGE2009 and MGOS 2.0.2
MacNair
manoj at deltacadd.com
Sat Nov 29 05:54:01 EST 2008
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;
}
--
View this message in context: http://n2.nabble.com/Application-compatibility-b-w-MGE2009-and-MGOS-2.0.2-tp1592042p1592042.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
More information about the mapguide-users
mailing list