473,396 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

DLL does not work on webserver

Hello, Please Help us...!

I have a big problem ,so i searched on google and other search engine ,then I realized that so many other people have the same problem and they, all, have'nt been able to solve it.
My problem is:


I want to import a dll in asp.net, and I have a major problem

First i want to say that this dll works fine in a windows application written in C#, and It works fine when I use the ASP.NET development server (Local machine).

But when I run the this code in Local host ( I upload it to my webserver ) ,asp.net know its Functions, but dont return anything or return wrong output adn return true output for sometimes.

Can it be something with the security rights the IIS has? or Web.config? or my way to Import?


......

for Example this Function code is:

[DllImport("mydll.dll")]
public static extern int GetTotal();


and when i call that ( in localhost )...

Response.Write( GetTotal().ToString() );

Output is: "-1" But when i use the ASP.NET development server (Local machine) It works fine, and Output is: "67"


.....


this Function works proprely in both ( Localhost and LocalMachine ):

[DllImport("mydll.dll")]
public static extern string ErrorDescription(int errorcode);


and when i call that ...

Response.Write( ErrorDescription(3) );

output in Localhost and Localmachine is : "invalid Account" !! therefore it works file in both.


......


this Function don't return anything in local host :


[DllImport("mydll.dll")]
public static extern string ServerGet(int index);


and when i call that ...


Response.Write( ServerGet(1) );

output in Localhost is empty! but in local machine output is : "219.39.43.34:244"

.....


i am sure that Asp.net knows this DLL well, and if it did'nt recognize it would give me an error, but my problem is that my dll do'nt works proprely when i run it in IIS.

do you know any solution ?
Can it be something with the IIS permissions?




=================================

some of the problems are mentioned below :

=================================


Hello,
I?m trying to use an unmanaged C dll from a ASP.NET 2.0 web application using p/Invoke platform (dllImport attribute). The asp.net page instances a c# library and this loads the C dll.
I?ve used this dll from a windows application without problems. But if this dll is invoked from a Web site it always return this error:
?Attempted to read or write protected memory. This is often an indication that other memory is corrupt?
When I use it from a web project using the web server of Visual Studio 2005 Environment it runs fine, but I? cant use it in a IIS Web. It is not a programming error, all methods invoked returns this error when are called from IIS Web site.
What do I have to configure to allow my web site to call unmanaged dlls?
I really need help.
Thanks a lot.
Marcelo

------------------------------------------------------------------------

I have an asp.net/C# application that uses third party dll to get some system information (get a unique machine id).

It works well on XP, 2000 and 2003, but when tried on Vista, IIS hangs when accessing dll methods (IIS Worker Process stopped working and was closed).

I tried different approaches to solve this problem but I'm stuck without anymore ideas to try.

I know asp.net is finding the dll (if I rename it, it shows an error of file not found), so I think it has to do with security.

I tried to impersonate (in web.config file), giving full access on file properties to IIS_IUSRS group, .NET Trust level to full, moving project to inetpub\wwwroot folder and some other tries.

If I use the dll on a winform application, it works great.

I've done a little dll on vc6 and it also works great on aspnet.


------------------------------------------------------------------------
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.

However, once again ASP.NET refuses to execute my inline ASP.NET code (Error Code)

Even the tip out of G00gle to use the full path in DllImport wasn't a
solution.
I've check this on my ISPs websapce and on my local IIS6.

Is the reason for this problem the general extremely over-limited runtime
permission of ASP.NET ?
Can ASP.NET or IIS6 be told to allow DllImport calls to my DLL ?
My ISP is ready to make configuration changes for my case but don't know a
solution, too.

Thx for your opinions !



------------------------------------------------------------------------
Hello everyone,

I developed my C# ASP.NET (Framework 1.1) application on my Windows XP Pro computer. I was able to use the follwoing to import a DLL and use its functionality with no problems. I was able to run the application on my computer without getting the "Unable to load DLL (client.dll)" message.

However when I uploaded the application to our Windows Server 2003 IIS server it gave me the following message:
Unable to load DLL (client.dll)

The calls I'm using are as follows: (I have three of these...but I'll only show one here to save space)
using System.Runtime.InteropServices;

[DllImport("client.dll")]
public static extern int MP4_ClientGetServerChanNum([MarshalAs(UnmanagedType.LPStr)] string m_sIPAddress);



------------------------------------------------------------------------


I want to import a dll in asp.net, and I have a major problem.

that this dll works fine in a windows application written in vb.net, the dll importation works just fine.

..........

Public Declare Function GMW_SetSQLUserPass Lib "GM6S32.dll" (ByVal sUserName As string, ByVal sPassword As String) As Integer

intres = GMW_SetSQLUserPass(SQLUserName, SQLPassword)

.............

But, when I run the same code in asp.net or even when I make a webservice of the functionallity I don't get anything back, nothing, not even an error.

Thanks


------------------------------------------------------------------------

I've created my web project on my localhost, all is working fine. But when I put them on my hosting (of course it support .NET Framework 1.1), I get this error as follow:

Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".

plz help me to solve this problem.

I complie my class (*.cs) into bin\*.dll by using csc command. So can these dll run on my hosting ??? all of dll files in bin folder can run on both of my localhost and my hosting without registing on the server ???



------------------------------------------------------------------------



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.dll 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?


------------------------------------------------------------------------

hi group,

i have a dll called dmcl40.dll written in c language. now i am using this from a winforms application using something like this

[DllImport(@"D:\123\456\bin\DMCL40.DLL")]

private static extern bool dmAPIInit();

Things work perfectly fine. but when i use the same code from webforms, the function call fails with no exception raised. do i have to do something else for this?

regards,

tpb


------------------------------------------------------------------------

When I compile and run my simple site under Visual Studio it works just find. However, when I set it up under IIS I get the errors. Please check the code and Error below. Is there something I need to configure on IIS to properly do DLLImport?


------------------------------------------------------------------------
Dec 21 '08 #1
1 7135
Plater
7,872 Expert 4TB
Is the DLL's property "Copy Local" set to true?
Dec 22 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: tooheys | last post by:
This may be to simple for the level of material I've already seen here, but nothing ventured. I have two web page linked from http://www.rhodeisland-aa.org/ricsmeetings/index.htm They are...
9
by: JDS | last post by:
The following is not working for me. What I want to do is this- my cgiparms have a variable Test_1 or Test_2 .... generated depending on what is chosen on a form. I want to check the value of...
1
by: Sal | last post by:
Greetings to all... I have a simple asp.net app. It consists of three aspx pages. I have enabled smart navigation on the pages. The app runs smoothly on the developer machine, but when I upload...
5
by: Dexter | last post by:
Hello all, I need all my developers work at a project simultaneous. How it is possible? I need a machine as web server? And how to configure the visual studio to all to work simultaneous? ...
0
by: Greg Cyrus | last post by:
When I use localhost as Webserver I can access everything. But running another Webserver on a seperate Computer in the network - I can open or create projects. As I understand the...
0
by: Markus | last post by:
Hi NG, I've got the following problem: I'am developing a Web-Application with asp.net but the debug-mode does not work. Developing in Visual Studio 2003 on win2000pro.
0
by: trend | last post by:
Does WSE really care (when authenticating via PKI) what type of webserver it authenticates to? Example: I have 10client programs that I handed out to my friends.. with each of these client...
3
by: wwwmike | last post by:
For some reasons my HTTP Redirect for 404 errors does not work for certain files like .gif .jpg on IIS Version: 5.1, but it works perfectly with the VisualStudio2005 internal webserver ...
4
matheussousuke
by: matheussousuke | last post by:
Hi, I have just uploaded a website to server, it's working fine, at least for one thing, if login to it on my computer (localhost) the login works fine, but if I do the same on webserver, it doesn't...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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,...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.