Link to home
Start Free TrialLog in
Avatar of Frohike
FrohikeFlag for Australia

asked on

DLL not able to Compile

Hi,

I'm running into a really frustrating time in developing my DLL. I do a lot of small changes to the DLL and need to recompile it all time. The problem is 8/10 times, it will not allow me to recompile the DLL as it is still being used by some application or the o/s.

I normally unregister the DLL and then stop IIS (and the other related services) and then start it up and re-register the DLL again. Some times, it does not work, and today has been one of those days where it has been a few hours now since I first tried recompiling the DLL. I've also rebooted a few times with no improvement.

Is there another way to ensure that the DLL is completely released? Is there a DLL flush utility that would help me do this?

Thanks.

Frohike
Avatar of nonubik
nonubik

You can use Process Explorer from sysinternals to see who's holding your dll and then act accordingly http://www.sysinternals.com/ntw2k/freeware/procexp.shtml
Just press CTRL+G (Find DLL) ant type your dll's name.
Or you could use Who's Locking, just right-click on your DLL and kill the processes that are locking your DLL...

http://www.codeguru.com/Cpp/W-P/dll/article.php/c3641/
try "Dependency Walker"! It saved me much time working with similar problems in my dlls.

Quick and dirty solution.
Download pskill:

  http://www.sysinternals.com/ntw2k/freeware/pskill.shtml

..and kill the DLL process when needed.

cloabell

Avatar of Frohike

ASKER

Hey all, I've tried all your suggested utilities and killed every process that are using my DLL.

You won't believe it, it still will not allow me to recompile the DLL.

The exact error msg is: Permission denied: '...path\myDLL.dll...'

I've been advised by someone that it could be something to do with the o/s itself using my DLL. If I had been using it frequently enough (which I believe I have when doing my unit testing), Windows 2000 Pro will automatically cache it for performance reasons. None of these utilities picked up any Windows processes using it, and therefore, cannot be killed.

So, if no visible process is holding my DLL, and after rebooting still does not release my DLL. By deduction, it has something to do with a file on the hard disk written by Windows. Is there way to flush this perhaps I might call this the page file?

I don't know if anyone else has encountered this problem. If anyone has experienced this any help will be appreciated.

Thanks,

Frohike

You have probably just tried this, but did you close and restart the visual basic environment?

Sometimes with vb6 I found that the IDE itself was locking the file.

Close vb6; restart it with your project, and compile your DLL before doing anything else.
ASKER CERTIFIED SOLUTION
Avatar of Diane258
Diane258

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Maybe a stupid question: is your dll read-only (or have some security restrictions)?
Avatar of Frohike

ASKER

Hi all, thanks for your replies so far.

nonubik, My DLL is not in readonly and there are no security restrictions.

Diane258, I tried remaking my DLL with a different filename and for some reason it actually released my DLL. I then delete my DLL and then remake it using the original filename. I don't like the sound of this, as it doesn't seem right as it appears to be locking up when it shouldn't.

Thank you all, for your help.

Frohike