MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




MapPoint 2006 object initialization fails in ASP.NET 2.0

This is a discussion on MapPoint 2006 object initialization fails in ASP.NET 2.0 within the Development forums, part of the MapPoint 2006/2009 Discussion category; Hello all, On a Windows 2000 Server machine, I have an ASP.NET 2.0 web service which calls the methods of ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion > Development

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack (12) Thread Tools Display Modes
  12 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 08-20-2007
Junior Member
White Belt
 
Join Date: Jan 2006
Posts: 4
MapPoint 2006 object initialization fails in ASP.NET 2.0

Hello all,

On a Windows 2000 Server machine, I have an ASP.NET 2.0 web service which calls the methods of MapPoint throught interop. Everything worked fine in MapPoint 2004 until I upgraded to MapPoint 2006. I get the following errors consistently:

1. System.Runtime.InteropServices.COMException (0x80080005): Retrieving the COM class factory for component with CLSID {31851F82-AFE6-11D2-A3C9-00C04F72F340} failed due to the following error: 80080005

2. System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {31851F82-AFE6-11D2-A3C9-00C04F72F340} failed due to the following error: 80070005

Thanks for all your help,

Dawa
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 09-04-2007
New Member
White Belt
 
Join Date: Sep 2007
Posts: 9
Re: MapPoint 2006 object initialization fails in ASP.NET 2.0

Can anyone else help with this - I have exactly the same problem.

I had everything working with MapPoint 2004 (Europe) but now nothing will work with 2006 (and I have tried going back to 2004 but now that worn't work).

I have tried the following (which originally worked to get MapPoint 2004 set up with ASP.NET 2005):

1) Run MapPoint and agree to the licensing terms.
2) Check that map loads and zoom around.
3) Close MapPoint.
4) Run MapPoint.exe /registerserver (using the correct folder path)
5) Open Component Services, find and expand DCOM Config, find the MapPoint entries in the list
6) For each MapPoint entry:
i) select Properties
ii) select the Security tab
iii) under Launch and Activation Permissions, select the Customize option then click the Edit button
iv) add the local ASPNET account to the list, tick all the boxes and click OK
v) repeat the above for the Access Permissions section
vi) click OK to exit the Properties dialog
7) Add a reference to the MapPoint COM Object in your .NET project.

That worked for 2004 but 2006 consistently gives me the error "
Retrieving the COM class factory for component with CLSID {15A40122-24D2-4FDB-8155-5F65FCE7017F} failed due to the following error: 80080005."

Can anyone help us?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 09-05-2007
New Member
White Belt
 
Join Date: Sep 2007
Posts: 9
Re: MapPoint 2006 object initialization fails in ASP.NET 2.0

OK, this may be of help.

I have found a workaround to this problem. I spent a day writing a simple Windows Service that registers a TCP Channel and exposes a 'Manager' object via remoting that will return a MapPoint instance.

Getting the Manager object in a test client app worked, but when it returned a MapPoint object it just hung, then timed out after a minute or so.

So I tried all sorts to get it working, thinking it was a remoting issue.

Turns out it was much much simpler than that - MapPoint was trying to pop up an EULA agreement dialog, but it never showed on the desktop. I turned on 'Allow service to interact with desktop' for my windows service and restarted it. Next time I ran my test app, up pops the EULA - I clicked I Agree and never had any problems (or further popups) after that!!!

And this is all despite me running MapPoint normally and agreeing to the EULA. Maybe it popus up an EULA for each new user that opens MapPoint for the first time?

If the same timeout or system hang is happening to you, and you check your running processes and see MapPoint.exe in the list, then I bet this is what is happening - the EULA is invisibly sat somewhere in virtual land waiting for a user to click I Agree.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 09-10-2007
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,122
Re: MapPoint 2006 object initialization fails in ASP.NET 2.0

Hi,

Thanks for feedback. So if I understand right you clicked 'agree' for the EULA with the MP desktop, but if you run your application as NT service then it needs again the 'agree' on the EULA but then from the NT service. Is that correct understand ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 09-11-2007
New Member
White Belt
 
Join Date: Sep 2007
Posts: 9
Re: MapPoint 2006 object initialization fails in ASP.NET 2.0

Hi Wilfried,

Yes - that's correct! I think the EULA pops up for every user the first time they use MapPoint on the machine, including if you run it in code with no GUI. Thinking about it, this would be true if being deployed as part of the server-side code for a website (runs under the ASPNET account) or a Windows service (runs under the LocalSystem account).

Hope that helps!

Paul.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 09-12-2007
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,122
Re: MapPoint 2006 object initialization fails in ASP.NET 2.0

Hi Paul,

thanks. I put it in the FAQ, this is very interesting.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 10-26-2007
Junior Member
White Belt
 
Join Date: Oct 2007
Posts: 2
Re: MapPoint 2006 object initialization fails in ASP.NET 2.0

I am using the MapPoint object in a web service. How do I go about agreeing to the EULA, to avoid this error since the web service is running on the server with no GUI? Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 10-29-2007
New Member
White Belt
 
Join Date: Sep 2007
Posts: 9
Re: MapPoint 2006 object initialization fails in ASP.NET 2.0

Hi cybergroove,

I was stumped as to how you could do this, but have found some articles which may provide you with a solution.

Since you are writing a webservice, I'll assume that it will run under the local ASPNET account, which does not have interactive desktop abilities. However, this article may help to remedy that:

Unable to Start a Process from ASP.NET

Failing that, you could add security impersonation to your webservice code. This would allow your webservce to start and run as normal under the ASPNET account, then you could switch to a known user account (you could set one up specifically for mappoint use if you wanted) just before you instantiate your mappoint object(s). Note that you may have to be switched to that account in each method call that accesses your mappoint object or there may be exceptions thrown.

There is a good article on adding an Impersonation class here:

Role Based Security in .NET

Note that with the latter option, you could create a local/network account specifically for your mappoint webservice, but you would need to log into the target deployment server under this account, run mappoint, agree to the EULA (and dismiss the registration popup if I remember correctly!) then exit mappoint. This will complete the EULA agreement for that user. Then you can log back in as the normal user of that server and install your webservice.

Hope that makes sense - this is just theory but I have used these techniques in other situations with success so I hope that gets you up and running.

If you find a working solution then post it here and we can tick the box for people writing webservices with mappoint as well!

Kind Regards,

Paul.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9 (permalink)  
Old 10-29-2007
New Member
White Belt
 
Join Date: Sep 2007
Posts: 9
Re: MapPoint 2006 object initialization fails in ASP.NET 2.0

Hi all,

Some additional information that might help.

I've just installed a fresh copy of MapPoint 2006 Europe on a machine and ran Process Monitor whilst agreeing to the EULA. It turns out that agreeing to the EULA creates the following registry entry:

HKCU\Software\Microsoft\MapPoint\13.0\EUR\
Name: EULA
Type: REG_DWORD
Value: 0x0000001 (1)

Now I'm going to try the same technique with a service running under the local system account, and see what registry entry gets set.

Paul.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10 (permalink)  
Old 10-29-2007
New Member
White Belt
 
Join Date: Sep 2007
Posts: 9
Re: MapPoint 2006 object initialization fails in ASP.NET 2.0

Hi again,

OK, some information that might just clinch it.

The key that gets set for the MapPoint EULA on other accounts seems to be in the registry section HKEY_USERS\. So for the Local System Account this is HKEY_USERS\.DEFAULT\Software\Microsoft\MapPoint\13 .0\EUR\EULA (Type: DWORD Value: 0x0000001 (1)).

So for any other account you run the MapPoint object under (other than the current user account which would be HKEY_CURRENT_USER), there would need to be an entry under HKEY_USERS for it.

So, for example, I wanted to debug where the registry setting was made for the ASPNET account.

So, first I changed my MapPoint Windows Service to run under the ASPNET account - in order to let ASPNET run this, I had to first set a known password for the ASPNET account (don't worry, you can reset this back to being system controlled by running "aspnet_regiis -i" afterwards).

Next, I added the ASPNET account to the DCOM configuration - in XP this is:
Component Services
Computers
My Computer
DCOM Config
Microsoft MapPoint
(right-click / Properties)
Security tab
Launch and Activation Permissions
select Customize option
click the Edit button
Add the local ASPNET account to the user names list
select the Local Launch and Local Activation checkboxes
click OK
Access Permissions
select Customize option
click the Edit button
Add the local ASPNET account to the user names list
select the Local Access checkboxes
click OK
click OK

Next, I started my service to see what happened - looked normal, but eventually got a timeout error in the Application event log because the MapPoint object failed to register with DCOM in a timely manner. This is because the EULA has not been agreed to for this account.

I looked in registry and found the new entry in HKEY_USERS which is for the ASPNET account. It is a GUID type of entry rather than just simply saying ASPNET! Under this I added the necessary entry for agreeing to the EULA (see above).

Now, I restarted my service and bingo! MapPoint runs fine with no errors in the event log and I can access my service.

The key to this is adding the DCOM entry for the account you want to run MapPoint under, and finding the correct key in the HKEY_USERS part of the registy to add the MapPoint EULA entry under. You don't need to change the password for the ASPNET account if you are running it under this - I just did this for the benefit of working out what was happening under the hood, so to speak.

Anyhows, post here if you find this solves your particular issue.

Kind Regards,

Paul.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
aspnet, fails, initialization, mappoint 2006, object


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/mappoint-2006-object-initialization-fails-asp-net-2-0-a-6174.html

Posted By For Type Date
Re: Problem to create a MapPoint instance - Mappoint This thread Refback 03-10-2008 02:29 PM
Problem to create a MapPoint instance - microsoft.public.mappoint | Google Groups This thread Refback 03-10-2008 12:53 PM
Re: Problem to create a MapPoint instance - Mappoint This thread Refback 01-30-2008 02:44 PM
Problem to create a MapPoint instance - microsoft.public.mappoint | Google Groups This thread Refback 01-22-2008 08:34 AM
Problem to create a MapPoint instance - microsoft.public.mappoint | Google Discussiegroepen This thread Refback 01-18-2008 03:24 PM
Virginia Map and Map of Virginia - MapPoint State Map Gallery - MP2K Magazine This thread Refback 08-30-2007 10:50 AM
Tracking P.F. Chang’s in the Midwest - MapPoint Articles - MP2K Magazine This thread Refback 08-28-2007 05:28 PM
DaWa | www.myresult.info This thread Refback 08-27-2007 10:27 PM
Merging Multiple Routes - MapPoint Articles - MP2K Magazine This thread Refback 08-25-2007 06:27 AM
Microsoft MapPoint 2006 - MP2K Magazine This thread Refback 08-22-2007 11:55 AM
Programming with MapPoint 2004 using the .NET Framework - MapPoint Articles - MP2K Magazine This thread Refback 08-21-2007 11:33 AM
MapPoint Articles - MP2K Magazine This thread Refback 08-21-2007 05:00 AM

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
FindPushpin fails dorenstein MapPoint 2006/2009 Discussion 3 10-14-2006 03:31 AM
Mappoint fails calculating the fastest route with avoided zo Anonymous MapPoint 2006/2009 Discussion 4 06-08-2004 07:27 AM
route object to drawing object Anonymous MapPoint 2006/2009 Discussion 1 05-09-2003 11:29 PM
QueryAllRecords Fails Anonymous MapPoint 2006/2009 Discussion 1 11-25-2002 06:09 PM
QueryAllRecords Fails Anonymous MapPoint 2006/2009 Discussion 0 08-29-2002 06:08 PM


All times are GMT -5. The time now is 12:28 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54