SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Zealot
    Join Date
    May 2004
    Location
    canada
    Posts
    145
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Creating COM object with .DLL

    Hi All,
    I am trying to use third party .DLL
    Before I added it by adding reference in my .NET Application, I can get the object on my local machine, but on web server I was getting error:
    Code:
    COM object with CLSID {634C9062-C052-4713-9C1B-EF1275DAE3FB} is either not valid or not registered.
    Now, I requested from my hosting company if they can register the .DLL for me on the server. After registering .DLL on server, I got different error:
    Code:
    Access is denied. 
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
    
    Exception Details: System.UnauthorizedAccessException: Access is denied. 
    
    ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user. 
    
    To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
    Any suggestions or help, please!

    Thank you in advance.
    rainbow11

  2. #2
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,633
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    You need to get your host to allow your application to run in high trust mode, or at least allow UnmanagedCodeAccess.

  3. #3
    SitePoint Zealot
    Join Date
    May 2004
    Location
    canada
    Posts
    145
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks wwb_99 for your reply,

    What is UnmanagedCodeAccess??

    thank you agian for your help!
    rainbow11

  4. #4
    SitePoint Wizard
    Join Date
    Feb 2007
    Posts
    1,274
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by rainbow11 View Post
    What is UnmanagedCodeAccess??

    It's a license to wreck havoc. Hosts love it!


    ------------
    Seriously, it is a security permission which will allow your ASP.NET account to call out of the .NET sandbox into "unmanaged code". This will bypass the isolation set up by application domains, and only the limitations of your account (e.g. write access) will then protect the servers integrity against buggy (or deliberately evil) applications.

    You need to take another look at this "component" and see if you really, really need it. Or if it can be ported to managed code.

  5. #5
    SitePoint Zealot
    Join Date
    May 2004
    Location
    canada
    Posts
    145
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by honeymonster View Post
    Seriously, it is a security permission which will allow your ASP.NET account to call out of the .NET sandbox into "unmanaged code". This will bypass the isolation set up by application domains, and only the limitations of your account (e.g. write access) will then protect the servers integrity against buggy (or deliberately evil) applications.

    You need to take another look at this "component" and see if you really, really need it. Or if it can be ported to managed code.
    thanks for your information.
    Yes, I need this, because I got this from the bank where I got my merchant. I need to use this COM object, so I can do real time credit card transactions.

    Thanks again!

    But why you said: "Hosts love it"

    Thank you again.
    rainbow11

  6. #6
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,633
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    ^^^That man speaks the truth. Unless you are on a dedicated box, and your IT people are slackers, you will probably not get said permissions.

    What is it your are trying to run?

  7. #7
    SitePoint Zealot
    Join Date
    May 2004
    Location
    canada
    Posts
    145
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by wwb_99 View Post
    ^^^That man speaks the truth. Unless you are on a dedicated box, and your IT people are slackers, you will probably not get said permissions.

    What is it your are trying to run?
    This is a plug-in that I got from where I got my merchant account. I need to use this COM object, so I can do real time credit card transactions.

    thanks again!
    rainbow11

  8. #8
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,633
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    I would start asking the host nicely for permission, asking the bank nicely for a .NET component or, failing all that, finding a dedicated host.

  9. #9
    SitePoint Zealot
    Join Date
    May 2004
    Location
    canada
    Posts
    145
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by wwb_99 View Post
    I would start asking the host nicely for permission, asking the bank nicely for a .NET component or, failing all that, finding a dedicated host.
    thanks wwb_99 for suggestion.
    How about other package between share hosting and dedicated hosting ---- Virtual Private Servers (VPS) ????


    If I got my own dedicated server or VPS, Is it hard to take care of this?? do I need to install everything on server by myself?? Any information or guidelines please.
    Thanks again for your help!
    rainbow11

  10. #10
    SitePoint Zealot
    Join Date
    May 2004
    Location
    canada
    Posts
    145
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by wwb_99 View Post
    I would start asking the host nicely for permission, asking the bank nicely for a .NET component or, failing all that, finding a dedicated host.
    Thanks wwb_99, yes, I requested nicely from my host and they said:
    "On the server side we have allowed full trust for the pages to use asp.net. Please try to re-compile the testmerchant.aspx once again with the required permission from your side and re uploaded the file, this will solve your issue."

    But still I have same problem?

    I try both of the following code and get different error. IS BOTH following code are same or different??

    Code:
           Dim obj As Object
            obj = CreateObject("testDLL.testClass")
    Show error: Retrieving the COM class factory for component with CLSID {634C9062-C052-4713-9C1B-EF1275DAE3FB} failed due to the following error: 80070005.

    Code:
    Dim objE As testDLL.testClass
    objE = New testDLL.testClass
    Show error: System.Exception: Cannot create ActiveX component

    ANY HELP PLEASE!
    thanks in advance for your help
    rainbow11

  11. #11
    SitePoint Zealot
    Join Date
    May 2004
    Location
    canada
    Posts
    145
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Please, Any help!
    ?????
    rainbow11

  12. #12
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,633
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    COM interop is not my thing, but I would ask the bank if they have any .NET code samples. I think you need to register the DLL and interact with it in a strongly typed manner rather than the good old Server.CreateObject() method.

    PS: You did define the site as running in full trust, correct?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •