views:

755

answers:

4

I followed the directions here: http://splinter.com.au/blog/?p=156 in an attempt to use a newer version of ODP.NET without installing the Oracle 11g client. I followed everything, so far, except for restarting IIS.

However, this has caused some problems and I'm really curious as to why. If I try to use ODP.NET I'm met with a blank exception thrown when the Oracle connection tries to connect (ConnectExample.Open() for instance).

But most curiously: I can't delete oci.dll. It says it's in use. What could be using this dll? What exactly does ASP.NET do with a native dll when it's within the Bin directory? I thought that maybe this is something involving the oci.dll, but if I use the dll in a similar fashion in a desktop WinForm application then the oci.dll doesn't get locked, and I can delete it freely.

Also, after I tried using it the normal System.Data.OracleClient stopped working. It now throws an exception that OCIEnvCreate returns with a -1.

I will try restarting IIS, and hopefully that will fix this, but I'd like to know what's going on here (and if it can be solved without restarting IIS). Does anyone have an idea?

Edit: I tried restarting IIS and that didn't fix a thing

Edit #2: I don't think I formulated this question very well, but that was due to my assuming restarting IIS would work. Now I just need to know why it isn't working. In Googling for similar problems I've only encountered 2 forum posts which told of my exact problem: Oracle ODP.NET returning a blank exception when trying to connect. Here's the links to those:

http://kr.forums.oracle.com/forums/thread.jspa?threadID=632296

http://forums.oracle.com/forums/thread.jspa?threadID=549864

The Korean link above is the most interesting. They have a full install which leads me to suspect my problem isn't with the files or missing files. I wonder what they mean by "production servers throwing blank exceptions if a call to the OCI DLL is made before the ODP one can be established"?

Edit/Update #3: We have an intranet server here for our department that I was able to test on today. I added the required dll's to the Bin folder and everything worked without the need to restart IIS. I don't ask. I'll try some more testing on this server to see if I can replicate the problem

Edit #4 (the odyssey continues): I determined that oraocci11.dll (the C++ call interface DLL) is needed initially by ASP.NET (or the ODP.NET library) to even find the 11g client dll's, after that oraocci11.dll seems to never be used again and can be deleted. Not sure what that means for my problem, but since it adds to the knowledge base here I figured I'd mention it

Edit #5: I added mfc71.dll and msvcr71.dll, 2 Windows systems files dealing with C/MFC, to the Bin directory as I discovered they're needed by ODP.NET (or at least, needed by the client). This, at the very least, made things stay on the old familiar "Client not compatible" error. I removed those 2 DLLs and sure enough it went back to the same errors given above. Adding them back didn't make those errors go away, however, so I'll have to reset IIS again.

+1  A: 

As for the DLL's, you'll have to stop IIS, delete them, then start IIS. This is because they are native DLL's, not C# dll's. C#'s 'shadow copy' feature doesn't apply to native dll's, which is why they are locked.

As for oracle, i've emailed you some stuff to try... really we should update this SO page when you find a solution.

Chris
Thanks, I'll try to try those files. Unfortunately I have no direct control over the server here, so it's a matter of requesting these things to be done. And even then, processes can only be stopped after 5:30 PM.Oh, any idea as to why the MS Oracle API stopped working?
Bob
These oracle api's are always a bit touchy i've found... it's difficult to say.
Chris
+2  A: 

Instead of (or as well as) stopping IIS, stop the World Wide Web Publishing Service using services.msc and then make your changes.

We found that for a graph control DLL being used by an asp.net application, just stopping IIS wasn't enough as you were not able to delete the file (or paste etc). But once the World Wide Web Publishing Service was stopped, it could then be deleted or overwritten...

davidsleeps
I thought that 'World Wide Web Publishing Service' was just a synonym for IIS ?
Chris
Maybe you're right...I'm just certain that I've had to stop the WWW Publishing service when stopping IIS wouldn't allow the change of files...worth confirming though for my own benefit
davidsleeps
asked the question on SU http://serverfault.com/questions/107053/is-stopping-iis-the-same-as-stopping-the-world-wide-web-publishing-service
davidsleeps
According to the answers given, they are two different things and it would stopping the World Wide Web Publishing service will free up used resources when restarting IIS wouldn't...
davidsleeps
Mate, you're the man. Good researching!
Chris
Thanks for the info on deleting it
Bob
A: 

First of all, this is not an answer. i apologize for posting the comment here, but I did not have the access to post comments.

I am experiencing the same problem as you. I am getting the blank error message on one server and on the other I am getting "The provider is not compatible with the Oracle client".

The oracle unmanaged dlls are also locked and cannot be deleted.

Have you found a solution to the problem.

I would appreciate if you could post your findings.

thanks

Jay
Unfortunately no, I haven't found the solution yet. I'm still looking...
Bob
A: 

Should it be that IIS is not the process locking the file, and you are really stuck, Unlocker can help with seeing what is actually locking the file, as well as releasing those locks and deleting the file forcefully.

Get it here

StingyJack