ASP.NET can't do what Windows Forms can do ..


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: ASP.NET can't do what Windows Forms can do ..

  1. #1
    MikeW Guest

    ASP.NET can't do what Windows Forms can do ..


    I have basically created a C# class library, which is a wrapper to COM.Interop
    calls to Excel.exe.

    When i reference this DLL from a Windows Application, I can quite happily
    call all the functions.

    However, if reference this DLL from a ASP.NET web page, using exactly the
    same code, all I get is "Server Execution Failed" ...

    I suspect that I am doing something wrong. If anyone can throw any light
    on the problem, I woud be very grateful.

  2. #2
    David A. Rothgery Guest

    Re: ASP.NET can't do what Windows Forms can do ..

    MikeW <mkwarby@hotmail.com> wrote:
    >
    > I have basically created a C# class library, which is a wrapper to COM.Interop
    > calls to Excel.exe.
    >
    > When i reference this DLL from a Windows Application, I can quite happily
    > call all the functions.
    >
    > However, if reference this DLL from a ASP.NET web page, using exactly the
    > same code, all I get is "Server Execution Failed" ...
    >
    > I suspect that I am doing something wrong. If anyone can throw any light
    > on the problem, I woud be very grateful.


    Do other ASP.NET applications (which don't reference the DLL) work for
    you? If no ASP.NET apps work, you've probably got IIS configuration
    problems.

    If other ASP.NET applications work fine, it's almost certainly a
    permissions issue. ASP.NET apps run as the asp_net user by default,
    which is a user with very few rights; you may have to give asp_net more
    rights or change the user ASP.NET runs as.

    --
    Dave Rothgery
    Picking nits since 1976
    drothgery@alum.wpi.edu
    http://drothgery.editthispage.com

  3. #3
    MikeW Guest

    Re: ASP.NET can't do what Windows Forms can do ..


    Thank you for your reply.

    Unfortunately, this is the only ASP.NET app that doesn't work. I have looked
    at rights issues, and even giving ASPNet user admin rights does not help.
    Someone else also suggested I try using the ASPCompat=true attribute, but
    this did not bear any fruit either.

    I do not know much about it, but I think it may be something to do with the
    way ASp.NET framework deals with Interop calls. If anyone knows more about
    this, perhaps they might have an idea. Once again, all help is appreciated.




    David A. Rothgery <drothgery@alum.wpi.edu> wrote:
    >MikeW <mkwarby@hotmail.com> wrote:
    >>
    >> I have basically created a C# class library, which is a wrapper to COM.Interop
    >> calls to Excel.exe.
    >>
    >> When i reference this DLL from a Windows Application, I can quite happily
    >> call all the functions.
    >>
    >> However, if reference this DLL from a ASP.NET web page, using exactly

    the
    >> same code, all I get is "Server Execution Failed" ...
    >>
    >> I suspect that I am doing something wrong. If anyone can throw any light
    >> on the problem, I woud be very grateful.

    >
    >Do other ASP.NET applications (which don't reference the DLL) work for
    >you? If no ASP.NET apps work, you've probably got IIS configuration
    >problems.
    >
    >If other ASP.NET applications work fine, it's almost certainly a
    >permissions issue. ASP.NET apps run as the asp_net user by default,
    >which is a user with very few rights; you may have to give asp_net more


    >rights or change the user ASP.NET runs as.
    >
    >--
    >Dave Rothgery
    >Picking nits since 1976
    >drothgery@alum.wpi.edu
    >http://drothgery.editthispage.com



  4. #4
    Calvin Guest

    Re: ASP.NET can't do what Windows Forms can do ..


    Try adding the following to your web.config file.

    <authentication mode="Windows"/>
    <identity impersonate="true" />

    This is what I had to do to get Excel to open on the server side of my web
    application. (Thanks Tom Barnaby!)

    Note, this was done for an Intranet site.

    Calvin...

    "MikeW" <mkwarby@hotmail.com> wrote:
    >
    >Thank you for your reply.
    >
    >Unfortunately, this is the only ASP.NET app that doesn't work. I have looked
    >at rights issues, and even giving ASPNet user admin rights does not help.
    > Someone else also suggested I try using the ASPCompat=true attribute, but
    >this did not bear any fruit either.
    >
    >I do not know much about it, but I think it may be something to do with

    the
    >way ASp.NET framework deals with Interop calls. If anyone knows more about
    >this, perhaps they might have an idea. Once again, all help is appreciated.
    >
    >
    >
    >
    >David A. Rothgery <drothgery@alum.wpi.edu> wrote:
    >>MikeW <mkwarby@hotmail.com> wrote:
    >>>
    >>> I have basically created a C# class library, which is a wrapper to COM.Interop
    >>> calls to Excel.exe.
    >>>
    >>> When i reference this DLL from a Windows Application, I can quite happily
    >>> call all the functions.
    >>>
    >>> However, if reference this DLL from a ASP.NET web page, using exactly

    >the
    >>> same code, all I get is "Server Execution Failed" ...
    >>>
    >>> I suspect that I am doing something wrong. If anyone can throw any light
    >>> on the problem, I woud be very grateful.

    >>
    >>Do other ASP.NET applications (which don't reference the DLL) work for


    >>you? If no ASP.NET apps work, you've probably got IIS configuration
    >>problems.
    >>
    >>If other ASP.NET applications work fine, it's almost certainly a
    >>permissions issue. ASP.NET apps run as the asp_net user by default,
    >>which is a user with very few rights; you may have to give asp_net more

    >
    >>rights or change the user ASP.NET runs as.
    >>
    >>--
    >>Dave Rothgery
    >>Picking nits since 1976
    >>drothgery@alum.wpi.edu
    >>http://drothgery.editthispage.com

    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center