« Previous Next »

Thread: OXC control is not working on IIS but works on Visual Webdeveloper webserver

Last post 07-16-2009 9:54 AM by jaydeepsatara. 12 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (13 items)

Sort Posts:

  • 07-13-2009, 4:41 AM

    OXC control is not working on IIS but works on Visual Webdeveloper webserver

    My code contains OXC control which populate itself from registry. This OXC is runing on STA thread. While I am running this application from Visual studio it runs as expected. But when I am trying to run the application after deploying it on IIS it is not working. The OXC control is populated with all values as empty.

    Could you please check with this issue.

    The code sniffet is as bellow;

    protected void btnViewOfferSCR9NXFer_Click(object sender, EventArgs e)

    {

    Thread tNITransfer = new Thread(new ThreadStart(NITransferCall));    tNITransfer.SetApartmentState(ApartmentState.STA); tNITransfer.Start();

    }

    private void NITransferCall()

    {

    AxtsARC objAxtsARC;

    objAxtsARC = new AxtsARC();

    objAxtsARC.CreateControl();

    objAxtsARC.XferToCampaign(12, true, 0, true);

    }

     

    The OCX object is populating but all of its default values.

    It is not reading registery of the server.

     

    Thanks,
    Jaydeep
  • 07-13-2009, 8:57 AM In reply to

    Re: OXC control is not working on IIS but works on Visual Webdeveloper webserver

    Does the account accessing the registry have permission to the registry?  Most likely the ASP.NET process account needs access, but that's dependent on how you set it up.

    Jeff

    Look for Wrox's new book Professional IIS 7 in your local bookstore, or order now at Amazon.com
  • 07-13-2009, 9:46 AM In reply to

    Re: OXC control is not working on IIS but works on Visual Webdeveloper webserver

     I have deployed the application on local IIS and with administrative previlages.

    But the case happens that;

    I have created .dll file for the old OCX control and having reference added in the web application. When I call, objAxtsARC.CreateControl(); this objAxtsARC object get populated from the system registery. Then by using above code I am calling all the properties and methodes of this control.

    When I run Application from visual studio it call all methodes of control as expected, But when I tries to do same after deploying on local IIS, the OCX control is not gets populated and does't giving any error on page / in event logger.

    Is there any requirement to load this control on IIS to use it from the IIS?

    Is there any setting on IIS to make OCX control to read system registery?

    Thanks,
    Jaydeep
  • 07-13-2009, 9:53 AM In reply to

    • tomkmvp
    • Top 10 Contributor
    • Joined on 03-20-2003, 6:27 AM
    • Central NJ
    • Posts 6,079
    • IIS MVPs

    Re: OXC control is not working on IIS but works on Visual Webdeveloper webserver

    As Jeff said ... 

    jeff@zina.com:
    Does the account accessing the registry have permission to the registry?  Most likely the ASP.NET process account needs access, but that's dependent on how you set it up.

  • 07-13-2009, 9:59 AM In reply to

    Re: OXC control is not working on IIS but works on Visual Webdeveloper webserver

    How to check for account accessing the registry have permission to the registry? 

    I have deployed application with administrative previlages.


    Thanks,
    Jaydeep
  • 07-13-2009, 10:04 AM In reply to

    • tomkmvp
    • Top 10 Contributor
    • Joined on 03-20-2003, 6:27 AM
    • Central NJ
    • Posts 6,079
    • IIS MVPs

    Re: OXC control is not working on IIS but works on Visual Webdeveloper webserver

  • 07-14-2009, 1:13 AM In reply to

    Re: OXC control is not working on IIS but works on Visual Webdeveloper webserver

    I tried it but  my application is not reading registry.

    Is there any settings on IIS to allow application to read system registery?

    Thanks,
    Jaydeep
  • 07-14-2009, 10:40 AM In reply to

    • tomkmvp
    • Top 10 Contributor
    • Joined on 03-20-2003, 6:27 AM
    • Central NJ
    • Posts 6,079
    • IIS MVPs

    Re: OXC control is not working on IIS but works on Visual Webdeveloper webserver

    No.  Anything blocking that would be permissions related.  What registry key(s) are you reading?

    Also, FWIW, an OCX is typically a client object and not a server object.

  • 07-15-2009, 2:28 AM In reply to

    Re: OXC control is not working on IIS but works on Visual Webdeveloper webserver

    I am reading registry key from  HKEY_CURRENT_USER\Software\TRG

    TRG is the application name an its registry settings.

    But, When I run Application from visual studio it populate and call all methodes/properties of control as expected, But when I tries to do same after deploying on local IIS, the OCX control is not gets populated and does't giving any error on page / in event logger.

    Thanks,
    Jaydeep
  • 07-15-2009, 11:10 AM In reply to

    • tomkmvp
    • Top 10 Contributor
    • Joined on 03-20-2003, 6:27 AM
    • Central NJ
    • Posts 6,079
    • IIS MVPs

    Re: OXC control is not working on IIS but works on Visual Webdeveloper webserver

    In a server environment there is no "CURRENT USER" so IIS can't find that key.  You might want to try this technique ...

    http://support.microsoft.com/?kbid=184291

  • 07-16-2009, 8:14 AM In reply to

    Re: OXC control is not working on IIS but works on Visual Webdeveloper webserver

    This is really very informative. I do not having any Idea about this. Thanks.

    I tryed this but it is still not working.

    Because In OCX control the code is written such that, data is fetched from the Current User  registery.

    I think then I need to change the code in OCX control also, i.e. to read HKEY\.Default right?

    Or is there any another solution?

    Thanks,
    Jaydeep
  • 07-16-2009, 8:26 AM In reply to

    • tomkmvp
    • Top 10 Contributor
    • Joined on 03-20-2003, 6:27 AM
    • Central NJ
    • Posts 6,079
    • IIS MVPs

    Re: OXC control is not working on IIS but works on Visual Webdeveloper webserver

    As I said earlier, an OCX is typically used by a client app and not server code.  Your best bet is to get support from the developer of the OCX to see what is needed to run this from server code.  There's not much more we can do to help you here as you're using something in a way it wasn't designed for ...

  • 07-16-2009, 9:54 AM In reply to

    Re: OXC control is not working on IIS but works on Visual Webdeveloper webserver

    Thank you very much.

    Then I will go with the traditional way of implementation i.e. through VB Script.

    Thanks,
    Jaydeep
Page 1 of 1 (13 items)