Hi,I wonder has anyone managed to get his/her VFP7 COM+ object run on ASP.Net 2.0 on IIS6

1. I compiled the object using MTDLL and deployed into my SBS2003.
2. I think this shouldn't be a security problem as I didn't manage to get it run even I have set the IIS6 worker to Local System.
3. The COM+ object has actually initialised. Codes in INIT method has actually run (I put CREATE TABLE ..... in the INIT method, and check if the table is created later), but when come to calling a method from ASP.Net, I hit an error.
4. Tried many possibilities, but no luck. I have also followed the example from Craig, got the same issue.
5. The same VFP7 class (but complied as EXE and configured as DCOM) was running fine on IIS5 ASP2.0 on Windows 2000 Server.

I am now totally lost. It is almost impossible for me to convert all VFP classes into .Net for some technical reasons.

Re: VFP7 COM+ object and ASP.Net 2.0 on IIS6 - Interop issue

Craig Berntson

Most likley it's a rights issue. The COM+ object, when called by IIS will run under your IIS account authentication. You can give IIS the rights needed or setup the COM+ component to run impersonated as another user (recommended).

Re: VFP7 COM+ object and ASP.Net 2.0 on IIS6 - Interop issue

Claude Fox

Try this (from ActiveVFP docs):

COM + Setup Instructions for a VFP mtdll:

1.) go into Control Panel, Component Services
2.) right click COM+ applications and select New.
3.) going through the wizard, create an Empty Application, giving it a name, check server application, and select the appropriate account to run under.
4.) After the Empty Application is created, right click on 'Components' under the newly created application.
5.) select New/Component.
6.) The wizard starts - select 'Import components that are already registered.'
7.) select your Visual FoxPro mtdll from the list and it is added to this COM+ app.
8.) right click on your COM+ application name and select 'Start'. The COM+ icon is now revolving in the Components pane.


Always use an mtdll for any kind of web app. Otherwise, you'll have some severe performance issues...

Re: VFP7 COM+ object and ASP.Net 2.0 on IIS6 - Interop issue


Thanks for the replies.

I did another testing yesterday, with EXE DCOM this time.

1. I setup a clean SBS2003 on a testing machine.
2. Copy all necessary VFP7 runtime libraries into SYSTEM32
3. Create a new testing website on IIS6 (run under defaultapplication pool)
4. Copy a testing VFP7 EXE file (declared as OLEPUBLIC) and register it by running the file with /regserver.
5. Open Component Service, went into DCOM folder, assigned all rights for Network Service under 'Launch and Activation' and 'Access' permissions, and set identity to Administrator.
6. Upload a simple ASPX page into the testing website. (With ASPCOMP set to True)


1. VFP7 Class:


RETURN (tnNum1 * 2)

The codes in ASPX page is something like this:

DIM aa AS MyTest.Test = New MyTest.Test
TextBox1.Text = aa.Method1 (10)

The ASPX page worked fine and I got the correct result from the class.

2. But when I added one more parameter to Method1 (also changed the code in ASPX page accordingly and removed and readded the Interop reference):

RETURN (tnNum1 + tnNum2)

I hit an error when I called the Method1 in the ASPX page. The error is something like: MEMORY CORRUPT.....

3. I also hit the same error when I added one more method (i.e. Method2) into the VFP7 class even both methods have only 1 parameter.

Actually I have a few very complicated VFP7 DCOM EXE objects, accessing data from native VFP DBFs as well as from an Adaptive SQLAnywhere server, running in the production server. Theses objects are called remotely from MS Excel, and I don't get any problem.

It seems like:
(1) It is not a rights issue as I managed to run the testing class and returned with a correct result.
(2) Complicated VFP7 objects run fine on production server (Windows 2003 and last time on Windows 2000) when called remotely from MS Excel, therefore it may be some interop issues when VFP7 object is being called from ASP2.0 on IIS6.

I will do more testing, for example test with MTDLL COM+ rather than EXE DCOM, change the IIS to IIS5 compactible mode, use VFP9 instead of VFP7. Will share the testing result here again if you are interested.

Re: VFP7 COM+ object and ASP.Net 2.0 on IIS6 - Interop issue


Finally, I got my COM+ component run on my testing machine. However, when I installed the same component into my production server, it failed. After many times of checking, I guess something is not right with my production server COM+.

When I start any COM+ application from the component services console, either my own app or the default appls ie IIS Out-of-process pool applications and etc, I got this error:

Catalog Error
An error occurred while processing the last operation.
Error code 800401E4 - Invalid syntax

There is no such error when I do the same thing on the testing server.

I have searched through the Microsoft Support website, but no luck. I have checked the permission as suggested by KB909444, everything seems OK.

Please help!!! Gosh! I hope I don't have to reinstall the server!!

Re: VFP7 COM+ object and ASP.Net 2.0 on IIS6 - Interop issue

Claude Fox

I would male sure the basic stuff works outside of COM+ on that production server. My suspicion is that runtimes or something like that are not in order...

Re: VFP7 COM+ object and ASP.Net 2.0 on IIS6 - Interop issue


The invalid syntax issue is solved. It is actually due to a missing registry key



I have to say thank you to Alex who posted this solution in http://www.talkaboutsoftware.com/group/microsoft.public.dotnet.framework.component_services/messages/6999.html

Same with Alex, I have no idea where the key gone missing!

However, my VFP COM+ object still run with error, I'm still working hard to find the solution.

Re: VFP7 COM+ object and ASP.Net 2.0 on IIS6 - Interop issue


Finally my VFP7 COM+ application is running!

I rebooted the server 2 days ago. I got DEP (Data Execution Prevent) warning and telling me that COM Surrogate and IIS Worker were disabled for security reason. I excluded these two from DEP and rebooted my SBS2003 again. After that my VFP COM+ application goes back to normal.

Actually I am now still not quite sure the exact reason causing the problem, but suspect these:

1. The missing registry key
2. DEP. However I remember I have actually excluded COM Surrogate from DEP months ago, and this is the first time I got IIS Worker in the list.

Anyway, thank you so much for you all, especially Craig Berntson and Claude Fox, and I hope this experience can help people who are having the similar issue.