From gbneff at cid.utah.gov Thu Dec 4 08:26:11 2025 From: gbneff at cid.utah.gov (Greg Neff) Date: Thu, 4 Dec 2025 09:26:11 -0700 Subject: [mapguide-users] FW: MGOS 4 - Creating Session In-Reply-To: dd829ceaee2bb9cde4d027ddd0fcb048@mail.gmail.com References: <7779dbe07be90fa1a25414c40e805ec3@mail.gmail.com> dd829ceaee2bb9cde4d027ddd0fcb048@mail.gmail.com Message-ID: I am still trying to solve the issue below and wondering if anyone on the list is having similar issues. There are no errors when building the project but every Mapguide Api call fails. I am probably missing something simple but can?t figure what it might be. Below is a list of the packages in my project: Thanks, *Gregory B. Neff* Cottonwood Improvement District 8620 S Highland Dr Sandy, UT 84093 801.943.7671 cottonwoodimprovement.gov *From:* Greg Neff *Sent:* Thursday, November 6, 2025 8:54 AM *To:* 'MapGuide Users Mail List' *Subject:* RE: [mapguide-users] MGOS 4 - Creating Session After additional research it appears that WebUnmanagedApi.dll can?t be found. The file is in my project. I double checked all the Mapguide references added with Nuget, versions are all v4.0.30319. VS Platform target is x64 and target framework is .NET Framework 4.8. MapGuide Server (Version 4.0.0.10202). Windows 11 Here are the references in my project: Here is the error message: *Gregory B. Neff* Cottonwood Improvement District 8620 S Highland Dr Sandy, UT 84093 801.943.7671 cottonwoodimprovement.gov *From:* mapguide-users *On Behalf Of *Gordon Luckett via mapguide-users *Sent:* Wednesday, November 5, 2025 3:15 PM *To:* MapGuide Users Mail List *Cc:* Gordon Luckett *Subject:* Re: [mapguide-users] MGOS 4 - Creating Session Instead of MgSite, I usually use MgSiteConnection.. Dim siteConnection As MgSiteConnection = New MgSiteConnection() siteConnection.Open(userInfo) (sorry vb example) On Wed, Nov 5, 2025 at 4:23?PM Greg Neff via mapguide-users < mapguide-users at lists.osgeo.org> wrote: MGOS 4 Final Iis 10 .net 4.8 Working on moving a site to MGOS 4 and having trouble creating a session using this code below which gives the following error: *The type initializer for 'OSGeo.MapGuide.WebUnmanagedApiPINVOKE' threw an exception.* *public partial class Cid_Map : System.Web.UI.Page * *{* * public string webLayout = "Library://layouts/Cid_Map_Basic.WebLayout";* * public string defaultUser = "Anonymous";* * public string defaultPassword = "";* * public string sessionId = "";* * protected void Page_Load(object sender, EventArgs e)* * {* * try* * {* * string realPath = Request.ServerVariables["APPL_PHYSICAL_PATH"];* * realPath = realPath.Replace(@"Cid_Map\", "");* * string configPath = realPath + "webconfig.ini";* * //Response.Write(configPath);* * MapGuideApi.MgInitializeWebTier(configPath);* * MgUserInformation userinfo = new OSGeo.MapGuide.MgUserInformation(defaultUser, defaultPassword);* * MgSite site = new MgSite();* * site.Open(userinfo);* * sessionId = site.CreateSession();* * }* * catch (Exception ex)* * {* * Response.Write(ex.Message);* * sessionId = "";* * }* * }* *}* Any help would be appreciated. *Gregory B. Neff* Cottonwood Improvement District 8620 S Highland Dr Sandy, UT 84093 801.943.7671 cottonwoodimprovement.gov _______________________________________________ mapguide-users mailing list mapguide-users at lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapguide-users -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 11096 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.png Type: image/png Size: 93602 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image003.png Type: image/png Size: 9328 bytes Desc: not available URL: From gbneff at cid.utah.gov Thu Dec 11 12:46:35 2025 From: gbneff at cid.utah.gov (Greg Neff) Date: Thu, 11 Dec 2025 13:46:35 -0700 Subject: [mapguide-users] FW: MGOS 4 - Creating Session In-Reply-To: f720bd06f354f0f8addb5b83b0cd298e@mail.gmail.com References: <7779dbe07be90fa1a25414c40e805ec3@mail.gmail.com> dd829ceaee2bb9cde4d027ddd0fcb048@mail.gmail.com f720bd06f354f0f8addb5b83b0cd298e@mail.gmail.com Message-ID: <4cd53f5893651a4de6f38fcf9e5da4c2@mail.gmail.com> Does anyone know why the bitness of Osgeo.Mapguide.Web.dll shows as x86 in Dependency Walker? Sigcheck says the same thing: Thanks, *Gregory B. Neff* Cottonwood Improvement District 8620 S Highland Dr Sandy, UT 84093 801.943.7671 cottonwoodimprovement.gov *From:* Greg Neff *Sent:* Thursday, December 4, 2025 9:26 AM *To:* 'MapGuide Users Mail List' *Subject:* FW: [mapguide-users] MGOS 4 - Creating Session I am still trying to solve the issue below and wondering if anyone on the list is having similar issues. There are no errors when building the project but every Mapguide Api call fails. I am probably missing something simple but can?t figure what it might be. Below is a list of the packages in my project: Thanks, *Gregory B. Neff* Cottonwood Improvement District 8620 S Highland Dr Sandy, UT 84093 801.943.7671 cottonwoodimprovement.gov *From:* Greg Neff *Sent:* Thursday, November 6, 2025 8:54 AM *To:* 'MapGuide Users Mail List' *Subject:* RE: [mapguide-users] MGOS 4 - Creating Session After additional research it appears that WebUnmanagedApi.dll can?t be found. The file is in my project. I double checked all the Mapguide references added with Nuget, versions are all v4.0.30319. VS Platform target is x64 and target framework is .NET Framework 4.8. MapGuide Server (Version 4.0.0.10202). Windows 11 Here are the references in my project: Here is the error message: *Gregory B. Neff* Cottonwood Improvement District 8620 S Highland Dr Sandy, UT 84093 801.943.7671 cottonwoodimprovement.gov *From:* mapguide-users *On Behalf Of *Gordon Luckett via mapguide-users *Sent:* Wednesday, November 5, 2025 3:15 PM *To:* MapGuide Users Mail List *Cc:* Gordon Luckett *Subject:* Re: [mapguide-users] MGOS 4 - Creating Session Instead of MgSite, I usually use MgSiteConnection.. Dim siteConnection As MgSiteConnection = New MgSiteConnection() siteConnection.Open(userInfo) (sorry vb example) On Wed, Nov 5, 2025 at 4:23?PM Greg Neff via mapguide-users < mapguide-users at lists.osgeo.org> wrote: MGOS 4 Final Iis 10 .net 4.8 Working on moving a site to MGOS 4 and having trouble creating a session using this code below which gives the following error: *The type initializer for 'OSGeo.MapGuide.WebUnmanagedApiPINVOKE' threw an exception.* *public partial class Cid_Map : System.Web.UI.Page * *{* * public string webLayout = "Library://layouts/Cid_Map_Basic.WebLayout";* * public string defaultUser = "Anonymous";* * public string defaultPassword = "";* * public string sessionId = "";* * protected void Page_Load(object sender, EventArgs e)* * {* * try* * {* * string realPath = Request.ServerVariables["APPL_PHYSICAL_PATH"];* * realPath = realPath.Replace(@"Cid_Map\", "");* * string configPath = realPath + "webconfig.ini";* * //Response.Write(configPath);* * MapGuideApi.MgInitializeWebTier(configPath);* * MgUserInformation userinfo = new OSGeo.MapGuide.MgUserInformation(defaultUser, defaultPassword);* * MgSite site = new MgSite();* * site.Open(userinfo);* * sessionId = site.CreateSession();* * }* * catch (Exception ex)* * {* * Response.Write(ex.Message);* * sessionId = "";* * }* * }* *}* Any help would be appreciated. *Gregory B. Neff* Cottonwood Improvement District 8620 S Highland Dr Sandy, UT 84093 801.943.7671 cottonwoodimprovement.gov _______________________________________________ mapguide-users mailing list mapguide-users at lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapguide-users -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 11096 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.png Type: image/png Size: 93602 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image003.png Type: image/png Size: 9328 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image004.png Type: image/png Size: 36600 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image005.png Type: image/png Size: 24431 bytes Desc: not available URL: