473,804 Members | 3,909 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dllimport makes the aspnet application hangs

As our application design requires us to use one of the validation API engine
which was written on C(so basically all I have is a dll) and I tested calling
the functions using small windows application using DllImport for each
functions and it works without any problem. But when I try to use the same
Dll in my asp.net web application, it hangs with the first call. I tried
giving the dll path as a hardcoded path like C:\validation.d ll in my
dllimport funciton call but did not help.

I am wondering it has something to do with ASPNET account security. So I
gave full control for ASPNET account for my application directory and still
my application hangs.

Anybody faced this earlier?

Nov 18 '05 #1
2 1824
You might try running FileMon from http://www.sysinternals.com and
use it to monitor all file access activities on your machine. It should give
you an idea of what's going on with your DLL. My guess is that you are on
the right track. If you can run it from a windows app and not a web app then
it is most likely a permission or file path issue.

--
Hope this helps,
Bryant Hankins
Numinet Systems Inc.
http://www.numinet.com

"sonyram" <so*****@discus sions.microsoft .com> wrote in message
news:65******** *************** ***********@mic rosoft.com...
As our application design requires us to use one of the validation API engine which was written on C(so basically all I have is a dll) and I tested calling the functions using small windows application using DllImport for each
functions and it works without any problem. But when I try to use the same
Dll in my asp.net web application, it hangs with the first call. I tried
giving the dll path as a hardcoded path like C:\validation.d ll in my
dllimport funciton call but did not help.

I am wondering it has something to do with ASPNET account security. So I
gave full control for ASPNET account for my application directory and still my application hangs.

Anybody faced this earlier?

Nov 18 '05 #2
Thanks Bryant for your reply. Actually I solved the problem. The reason is
not security which I come to know after series of trying(like giving the
aspnet account more privs). The reason is the first init call requires a
filename parameter and I just gave only the filename and as it is an aspnet
application, it tries to find that file system32 directory where it could not
locate and it was waiting there. Once I hardcoded the value to local bin
directory, it started working

"Bryant Hankins" wrote:
You might try running FileMon from http://www.sysinternals.com and
use it to monitor all file access activities on your machine. It should give
you an idea of what's going on with your DLL. My guess is that you are on
the right track. If you can run it from a windows app and not a web app then
it is most likely a permission or file path issue.

--
Hope this helps,
Bryant Hankins
Numinet Systems Inc.
http://www.numinet.com

"sonyram" <so*****@discus sions.microsoft .com> wrote in message
news:65******** *************** ***********@mic rosoft.com...
As our application design requires us to use one of the validation API

engine
which was written on C(so basically all I have is a dll) and I tested

calling
the functions using small windows application using DllImport for each
functions and it works without any problem. But when I try to use the same
Dll in my asp.net web application, it hangs with the first call. I tried
giving the dll path as a hardcoded path like C:\validation.d ll in my
dllimport funciton call but did not help.

I am wondering it has something to do with ASPNET account security. So I
gave full control for ASPNET account for my application directory and

still
my application hangs.

Anybody faced this earlier?


Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
18531
by: Michael Tissington | last post by:
I have a C# function that calls into a C++ DLL I have placed the DLL in the 'bin' folder of my asp.net project I'm using something like However when I try to call the function I'm getting an error 'Unable to Load DLL'
15
4469
by: Jim | last post by:
I am extremely frustrated. I am building c# application for a call center and am using a third party API to access some hardware. When develop and test my class using the windows console the application runs flawlessly, but once I call the class from inside a c# windows application the program freezes, crashes etc... there must be a way to make this work inside a windows app as it run great as a command line app.
1
3697
by: Daniel Frede | last post by:
Hello, I Created a AxSHDocVw.AxWebBrowser in a class and want to Post Values to a WebPage. When I use this class in a Windows application, everything is fine, but in an ASPX page it hangs after the .submit (see code) Even if i try to start the class in a new thread it terminates at the ..submit
2
10483
by: Brian Anderson | last post by:
Hello, is it possible to use DllImport to call a DLL in ASP.NET ? Or is it necessarry that my DLL has to be copied into \System32 ? My DLL is a native C++ 7.1 DLL (not managed, no COM, no regsvr32) and uses Assembler to make some math in SSE. The result is given out as an Int. Using a C# console app (code below) it work fine & fast.
8
2936
by: =?Utf-8?B?UHVjY2E=?= | last post by:
Hi, I'm using vs2005, .net 2, C# for Windows application. I use DllImport so I can call up a function written in C++ as unmanaged code and compiled as a dll us vs2005. My application is able to call the function, EncodeAsnUser. And it's returning OK but when I display the decoded data in another part of my application it shows no data has been decoded, all fiedls are either null or blanks. For some reason, I am not able to step through...
1
8084
by: Thomas Due | last post by:
Hi, I manage an rather old application in which we have some fairly complex (ugly) Delphi code. This is Delphi 6 we're talking about. Among all this Delphi code there is method for formating a print layout for slip printers. Pass a few parameters to this method and it returns a Delphi string which contains the entire slip, ready for sending to the slip printer. Now, we're slowly migrating to .NET and am in need of printing this slip...
1
2086
by: Seth Gecko | last post by:
Hi I am developing a complex VB.Net Windows application for an engineering firm (don't ask me why they prefer VB.Net...). All the engineering calculations are done in FORTRAN which is compiled to a non COM type DLL (meaning you can't create an Interop for it). This is called from within the .Net application using DllImport, just like using a Windows API call. This works fine. The problem arises when we create threads (using BeginInvoke)...
0
1712
by: Nelson R. | last post by:
Greetings, I've already posted this message on aspnet.security group (think its related to security issues), but since didn't get any response, I post it here. -- I have a problem, and been around it for some days without finding a solution. I have an aspnet 1.1 application that works perfectly on Windows XP, Windows
4
2231
by: tk121 | last post by:
Hello - I have some code I'm invoking with DllImport and the functions work flawlessly while executing through the debugger, but not in the stand-alone executable. When running the exe, the program hangs as soon as it gets to executing the dll. After awhile it will say "(Not Reponding)". The code also works on console applications, both in the debugger and the built executable. So, what's the difference between the console app and the...
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10575
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10330
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10319
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6851
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5520
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3816
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.