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

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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

.



Relevant Pages

  • Re: ASP.Net client sending XML string to remote .net web service
    ... There is a URL Behavior property of the WebService which defaults to ... Changing it to dynamic allows the Web Reference URL to be placed in ... > generate an xml string from a db and then send it to a web service on ... > the same box (client is part of the same service) which then processes ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Web service - Large dataset problem
    ... Compressing the xml string ... database on the client side and pass the DataSet to the webservice. ...
    (microsoft.public.dotnet.framework)
  • Re: Issue using an unmanaged dll in a ASP.Net 2.0 Webservice
    ... When you know you'll get the error (I suspect its when w3wp.exe is not ... filemon.exe and check where the native dll is being probed for when the call ... I have an ASP.NET 2.0 Webservice running on Windows server 2003. ... XML string and returns an XML string. ...
    (microsoft.public.dotnet.framework.webservices)
  • Calling Unmanaged .dll in webservice which works intermittently
    ... I have an ASP.NET 2.0 Webservice running on Windows server 2003. ... XML string and returns an XML string. ... get the old "Unable to load DLL" error. ...
    (microsoft.public.dotnet.framework.interop)
  • DLL problem
    ... I am developing a webservice that uses a third party dll. ... I added the dll as a reference in the offline part and the ... string dir = System.Environment.CurrentDirectory; ...
    (microsoft.public.dotnet.framework.webservices)