views:

410

answers:

3

I've a simple, if not primitive, C++/CLI .NET 2.0 class library. It is used in order to wrap some C++ legacy code for the Web Service. The following facts appear to be true:

  1. Primitive C# test program calls class library and it works.
  2. If class library does not refer to any modules of our code base, it works as well as part of the web service. That is, I load the web service and invoke the methods and receive proper response.
  3. The same moment I replace the copied and pasted code by the calls from our code base libraries, the Web Service stops to load. I get System.IO.FileNotFoundException message.

The problem: I cannot find any place where the file name that couldn't be found is written.

I googled it and gave some permissions to some ASP.NET user on my computer. I copied all the DLLs of our libraries into the same directory where web service is installed. I searched in IIS logs, event logs, etc - no where could I find the name of the module that prevents the web service from coming up.

Any help on the matter would be greatly appreciated.

Boris

A: 

What calls are you replacing? Could it be the original code gracefully handles missing files (which may not even be important) and yours does not?

Andrew Grant
Andrew, the original code is simple string handling routines. But silly me did not realize that the DLLs need to be in the system path, as ASP.NET runtime makes copies of everything and runs it from the copy location.
Boris Liberman
A: 

Add same rights to the iusr-account that you did to the asp.net-account.

Stefan
Given that the service runs if compiled differently it does not seem to matter. But I solved the problem nonetheless.Thanks!
Boris Liberman
A: 

Make sure all the dependent DLLs are in the path (Path meaning not the directory where your assembly is, because ASP.net copies your assembly away into a temporary folder, but rather a directory that's included in the System path environment variable).

Assaf Lavie
Yes, that indeed was the culprit.
Boris Liberman