problem with mappoint on windows server 2003 using c#

laminac
10-19-2007, 11:33 AM
I'm using mappoint 2004. I have a c# form that runs fine on windows xp, but when I move it to the windows server 2003 machine it does not work. I have mappoint 2004 installed on both machines. Here is a snippet of my code

ApplicationClass app = null;
Map map = null;

public Form1()
{
InitializeComponent();
app = new ApplicationClass();
map = app.ActiveMap;
}


when the form starts it runs this code, but map is still null, I get a null pointer exception later on in my code and it is because app.ActiveMap = null.


This only happens on the windows 2003 server, On my windows XP machine it works fine. I noticed that when I run this code on my windows XP machine it starts a task called MapPoint.exe in the task manager. This is not happening on the Windows 2003 server. I beleive this is why ActiveMap is equal to null. This leads me to believe it is a setting, but I don't know where any settings would be that would start this.

I've installed Visual Studio 2005 on the windows 2003 server, and set up all the references for mappoint and everything and re-compiled it on that box, but I get the same result.

Any help would be greatly appreciated. Let me know if you need any more information.

Wilfried
10-23-2007, 08:53 AM
Hi,

I assume that if you start manually mappoint.exe application that it runs normal ? Also did you clicked on the agree from the licence agreement ?

You could try to move the code to the form load event instead of putting it in the constructor of the form.

if this all does not help, it could be that it has something to do with rights on the 2003 server ? do you run as administrator ? If not try so. I recall also that you again have to run mappoint and again agree on the licence agreement or it will not work !

laminac
10-23-2007, 10:18 AM
Thanks for the reply. I am able to start mappoint if I click on the exe. I've accepted the licence and everything. I am also running as Administrator. I've tried moving the code into other places, even in the specific function without luck.

I am running as Administrator. I believe it is something weird with this machine. I've installed it on another 2003 server and it is working on that server. The only problem is it is not working on our IIS server :bluewink:.

I've checked file permissions, Are there any other permissions you can think of? Thanks.

Wilfried
10-23-2007, 10:28 AM
Hi,

I'm not familiar with 2003 server. security permissions somewhere ?

laminac
10-23-2007, 03:15 PM
okay I found my solution. Here it is for anyone else who runs into this problem. I uninstalled Map point. I then went into the registery and did a search for mappoint. I deleted MOST of the registry settings. There were some that corresponded to IIS that I didn't want to delete. After deleting the registry keys I re-installed it and it worked. It must have been something weird in my install. Thanks everyone for your help.

Eric Frost
10-23-2007, 03:58 PM
Cool. Thanks for following up. Can you give more details on what you did not delete?

Eric

 
Web mp2kmag.com
mapforums.com