Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
HTTP 500 errors when referencing VFP dll
Message
General information
Forum:
ASP.NET
Category:
Web Services
Environment versions
Environment:
ASP.NET
OS:
Windows Server 2008
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01577871
Message ID:
01578146
Views:
58
VFP COM components in ASP.NET outside of WebForms are always problematic because of .NET's default MTA threading model. You can't 'just run' VFP COM components in MTA - it'll work for simple things but the first time you get load it'll blow up.

The code I posted works and I've used that in a few projects - it's doable that way and the code is mostly boilerplate. Alternately you can also run your COM component in COM+, but there's a severe performance hit for that and administration can be a pain if you need to update your component frequently.

Good luck...

+++ Rick ---

>Oh, that doesn't sound fun. Yes, I'm using ASMX as I thought that was the preferred method to wrap a VFP web service. My initial thought was to simply expose VFP web service directly, but was told that is insecure?
>
>Basically, I'm trying to get a menu option setup for a VFP client to be able to reach out via the web to our server and synchronize data between the client and server. The machines will only periodically be online.
>
>Am I chasing down a rat-hole here?
>
>
>>Are you running a WCF or ASMX service on the server?
>>
>>If so, be aware that this will cause you some serious grief as these services require MTA COM components. VFP is STA. Although things might appear to work under low load or single user testing, with simultaneous users you will see crashes.
>>
>>There are some ugly workarounds for this. More info can be found here:
>>http://www.west-wind.com/weblog/posts/2012/Sep/18/Creating-STA-COM-compatible-ASPNET-Applications
>>
>>The only in the box 'supported' safe way to run VFP COM components natively in ASP.NET is by using WebForms and AspCompate="true".
>>
>>+++ Rick ---
>>
>>>I have an ASP.NET web service wrapper for some VFP functions that I have developed. In my development machine using Visual Studio 2008 (and have now tried VS 2013 preview) and the internal web server, all runs well. When I deploy my web service to a production server, even the HelloWorld function returns an HTTP 500. It seems that as soon as I have a DLL referenced in my web service, the whole project dumps. Considering this works in the local Visual Studio web server/browser, shouldn't it work on the IIS 7 server as well?
>>>
>>>I have tried the following:
>>>
>>>1. Successfully registered the amsync_web.dll with regsvr32 on the server in the development directory. I get the HTTP 500
>>> *note* that there is also an interop.amsync_web.dll in the bin directory of the web folder.
>>>2. Removed the interop.amsync_web.dll from the bin folder. Now I get a compilation error BC30002: type 'amsync_web.amsync_web' is not defined.
>>>3. Fine, I unregistered the development copy of the dll and tried to register the interop copy in the bin directory. Get ugly error and unable to register.
>>>
>>>Can anyone help steer me on what I thought should be a fairly straightforward process? Much gratitude to anyone who can keep me from wasting any more hours of time on this...
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Reply
Map
View

Click here to load this message in the networking platform