asp.net + unmanaged dll security issues

Discussion in 'ASP .Net' started by Guest, Nov 1, 2004.

  1. Guest

    Guest Guest

    Hi,
    I'm developing an ASP.NET application. I imported a C++ dll into the C# code.
    When I tried to access a function in that dll, application threw an exception
    "System.Runtime.InteropServices.SEHException:External component has thrown
    an exception". I debugged the unmanaged C++ code & found that the code that
    generated this exception is

    CDaoDatabase db;
    db.open("C:\\VM.mdb") // this is the code that generated exception

    I tried using try catch blocks
    but the control does'nt come to catch block
    How do i determine the exception?
    The same dll function works fine if the dll is impoted in a Windows
    application.
    Is there any security issues in Web application?

    Thanks in advance
    Priya
     
    Guest, Nov 1, 2004
    #1
    1. Advertisements

  2. Guest

    bruce barker Guest

    to get better error reporting, the c++ nneds to trap errors, and supply an
    error reporting function. in your case the error is probably permission, as
    asp.net does not have access rights to @"c:\" by default.


    -- bruce (sqlwork.com)
     
    bruce barker, Nov 1, 2004
    #2
    1. Advertisements

  3. Guest

    Guest Guest

    I tried setting the write permission to the database file(I:\data\VM.mdb) ,
    the folder containing the database file , to the aspx file and the folder
    containing it in ASPNET account , Everyone , IUSR_Machinename account.

    I added <identity impersonate ="true"> in web.config file.
    The ASP.NET state service has default logon as Local System Account.

    I modified username= "machine " to username = "system" in machine.config
    (C:\Winnt\Microsoft.Net\Config\machine.config)
    still it does'nt work.

    What is the mistake i'd done???
    Thanks
    Priya
     
    Guest, Nov 2, 2004
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.