MSProject VS Interop problems

Hello,

I am trying to implement a server side .mpp file analyzer and handler for various web services. I have the MS Project 2003 PIA interops and everything is working swell.

My problem is the processes that load. Sometimes WINPROJ.EXE loads and just hangs there until I kill it. Sometimes WINPROJ.EXE spawns the msiexec.exe installer process which uses up over 50% of my resources for several minues. The interesting thing is msiexec.exe will not spawn if i run Project normally.

When I call the interop I am using this code (in c#):


MSProject.ApplicationClass app = null;

try
{
app = new MSProject.ApplicationClass();

app.OpenXML(xmlProj);
....
....
app.FileExit (PjSaveType.pjSave);
app = null;
....
....

I've tried the other object closing methods, but they all seem to behave the same way.

Usually the problems go away if I leave the system alone for a few minutes (1-5), but this is not an acceptable solution to my problem since many transactions can be going on at any moment.

I have considered 2 other alternatives:

1.) Load the object on a global level, and just call it everytime instead of spawning a new object. The problem with this is I cannot run Project when the process is running! The new project thread is waiting for the old one to finish. This makes things frustrating when developing/debugging.

2.) Make a process killer that will kill winproj.exe and msiexec.exe (and sometimes dw20.exe) at any chance it can get, but that is a very very bad idea. I only considered this since the machine will not have anything else running on it besides the web services.


I'm beginning to think theres some garbage collection issues, but I'm not too sure. I've been searching high and low, but nobody seems to have an answer. Any thoughts/suggestions to my problem


Thank you!


Answer this question

MSProject VS Interop problems