473,385 Members | 1,753 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,385 software developers and data experts.

Issue using an unmanaged dll in a ASP.Net 2.0 Webservice

Hi,

Any help with this problem would be greatly apprecicated as it is driving me
insane.

I have an ASP.NET 2.0 Webservice running on Windows server 2003. The
webservice calls a function in a legacy (unmanaged) C++ .dll which takes an
XML string and returns an XML string. It all works rather nicely most of the
time.

However, if the service isn't used for a while, when I call the function, I
get the old "Unable to load DLL" error. If I then restart the webservice, it
starts working again.

Here is my dll import declaration:

[DllImport(@"C:\GridVersion\CLibDll.dll", CallingConvention =
CallingConvention.StdCall)]
public static extern void calculateRequestFromDotNet(StringBuilder request,
StringBuilder response);

Any ideas on how I can even begin to resolve this issue would be
really,really appreciated.

Many thanks

Rob

Feb 27 '08 #1
1 2050
When you know you'll get the error (I suspect its when w3wp.exe is not
running) and before you perform the first call, make sure you run
filemon.exe and check where the native dll is being probed for when the call
is made.

Tiago Halm

"austirob" <au******@discussions.microsoft.comwrote in message
news:F7**********************************@microsof t.com...
Hi,

Any help with this problem would be greatly apprecicated as it is driving
me
insane.

I have an ASP.NET 2.0 Webservice running on Windows server 2003. The
webservice calls a function in a legacy (unmanaged) C++ .dll which takes
an
XML string and returns an XML string. It all works rather nicely most of
the
time.

However, if the service isn't used for a while, when I call the function,
I
get the old "Unable to load DLL" error. If I then restart the webservice,
it
starts working again.

Here is my dll import declaration:

[DllImport(@"C:\GridVersion\CLibDll.dll", CallingConvention =
CallingConvention.StdCall)]
public static extern void calculateRequestFromDotNet(StringBuilder
request,
StringBuilder response);

Any ideas on how I can even begin to resolve this issue would be
really,really appreciated.

Many thanks

Rob

Mar 1 '08 #2

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

Similar topics

0
by: Russ | last post by:
I'm trying to use InteropServices in a web service, by following the examples and info in the article "Consuming Unmanaged DLL Functions" in the .NET Framework Developer's Guide. I am able to...
7
by: Johan Jooris | last post by:
I can imagine that C++ will remain to have its place in a special kind of applications (device drivers, operating systels, ...) But what is the future of unmanaged C++ for 'normal' applications...
1
by: Andy | last post by:
Hello, I have a WebService that sends a client a DataSet as XML (I use a DataSet.GetXml to get the XML). The DataSet is filled by a DataAdapter in the WebService. The client coverts the XML Back...
5
by: GeRmIc | last post by:
Hi, I am doing an interop from unmanaged code to C#. How do i pass an ArrayList pointer from an unmanaged code, (structres are easily passed by between C# and C). //This is the C code ...
7
by: Kristof Thys via .NET 247 | last post by:
Post a new message to microsoft.public.dotnet.languages.vc http://www.dotnet247.com/247reference/default.aspx Hello, I've been struggling for weeks with this problem, I hope I find some...
0
by: Maxwell | last post by:
Hello, I recently completed a MC++ (VS2003) DLL that wraps a non MFC C++ DLL and need to use it in a MC++ Console Application (no forms/guis of any kind just output to console). Trouble is...
0
by: Rob C | last post by:
I have an unmanaged app written using VS2003 VC++. I was able to connect to a webservice by selecting "Add Web Reference" and selecting a WSDL file in the project menu. This created a header file...
0
by: nhaughton | last post by:
I have writtten a webservice in .Net 1.1 using C#, that exposes an existing COM+ application as a webservice to remote web applications. The COM+ application works fine under Win 2000, XP amd...
2
by: =?Utf-8?B?TGFycnlLdXBlcm1hbg==?= | last post by:
Our WebDev team seems to have found a problem that exposes a bug in .NET 2.0. This problem can be shown when trying to access a WebService using SSL and through a proxy server after using the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.