Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / June 2004

Tip: Looking for answers? Try searching our database.

aspnet_wp reboot required regularly

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Akoni - 16 Jun 2004 06:35 GMT
Hello,

I have written a ASP.NET (C#) front-end that connects to an unmanaged win32
c++ dll. A few problems occur:

-I am unable to use the IO stream (write to an event log) from the dll.
Although I can successfully use an IO stream when calling the dll from a
regular .net Windows Form.

-The program behaves very inconsitently. Normally I can connect to my
database (via the unmanaged C++ dll) for the first time only. After this it
will crash everytime UNTIL I restart the aspnet_wp process from the task
manager (at which time I can again connect to the database one time).

This will never be a productive product unless I can get a handle on why I
need to reboot aspnet_wp every 5 minutes.

Has anyone else experienced problems with aspnet_wp.exe?

Thanks!
Eric Means - 16 Jun 2004 20:36 GMT
> Hello,
>
> -I am unable to use the IO stream (write to an event log) from the dll.
> Although I can successfully use an IO stream when calling the dll from a
> regular .net Windows Form.

This will be a permissions problem.  ASP code runs as a specific user
(IUSR_[MachineName] IIRC) and that user has very limited permissions.
You will need to give the user permissions to write to the event log
or have ASP impersonate another user.

> -The program behaves very inconsitently. Normally I can connect to my
> database (via the unmanaged C++ dll) for the first time only. After this it
> will crash everytime UNTIL I restart the aspnet_wp process from the task
> manager (at which time I can again connect to the database one time).

I highly doubt this is ASP.Net's fault; most likely, you're not
correctly closing or releasing some resource, or corrupting memory, or
something.
Akoni - 16 Jun 2004 21:21 GMT
Thanks Eric,

I tried giving the ASPNET account administrator privileges, but still the
same results. Here is the code snippet from the unmanaged C++ dll:

GetExePath ( szEventLogPath ) ;
_tcscat( szEventLogPath, "eventlog.txt" ) ;

     // open the log file
     ofstream r_os( (char*)szEventLogPath, ios::app | ios::ate ) ;
     if ( r_os == NULL )
        return ;

r_os always end up being NULL (so it never even tries to write). It like it
can't create an ofstream if the dll is called from the ASP.NET front end.

> > Hello,
> >
[quoted text clipped - 15 lines]
> correctly closing or releasing some resource, or corrupting memory, or
> something.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.