Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4062546
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:36:43+00:00 2026-05-20T15:36:43+00:00

Recently, I am facing an issue I thought it would be easy to implement.

  • 0

Recently, I am facing an issue I thought it would be easy to implement.
I have a COM object already installed on my Windows 7 machine.
I am trying to build a webservice or WCF service around this COM object.
Unfortunately, no matter what I try seems useless.

I have both Visual Studio 2008 and 2010 installed.
Using the VS IDE, I created a reference to the COM and as expected, VS automagically created the interop DLL needed to access the members of COM.

When I try this in a winforms application, everything works fine, but when used in a service my luck is gone.

The code is supersimple and it looks like this:

LCDirect_WebLogin.CoClass_n_ap_com com = (LCDirect_WebLogin.CoClass_n_ap_com)obj.Unwrap();
object value = null;
string name = "";
com.getsysteminfo(name, ref value);
if (value != null)
    return value.ToString();

So, the same code in winform app works fine but under IIS it crashes.

A few extra info:
Finally I need to deploy on a Windows 2003 Server.
The COM DLL depends on PowerBuilder runtime. I copied the PB runtimes in my system32 and also in bin folder for webservice.

I don’t think it’s a dependency issue, but rather a security issue with calling unmanaged code.

I also tried running the webservice under a more proviledged account using the App Pool and using an administrator account to run under. Same issue.

Any ideas?
Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T15:36:44+00:00Added an answer on May 20, 2026 at 3:36 pm

    Finally I solved my problem.
    The solution is to run your COM object in STA mode.
    I found the solution here: http://www.techrepublic.com/article/application-development-calling-a-com-object-from-a-web-service-in-net/5152421

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a massive client facing web application here. We recently re-wrote the buy
I have recently integrated facebook comments on my photo gallery. I am facing a
Recently deployed my web app on Windows Server2008, IIS7 (with Office installed). After chasing
Recently, I have been facing a problem with throwing exception in JDBC topic. I
Recently I have been investigating the possibilities of caching in ASP.NET. I rolled my
I am facing strange issue with our WCF service. The same code was working
At home I've been running VS 2010 on a Windows 7 x64 machine without
we have recently added a new feature to our software - preview generation for
i converted recently from wxpython to pyqt and im still facing alot of problems
I recently installed rails in fedora 12. I'm new to linux as well. Everything

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.