tags:

views:

97

answers:

2

How can I tell if an assembly is in use by any process?

A: 

If you want to know if your application has loaded the assembly, you can inspect the AppDomain for loaded assemblies. If you want to know if the assembly is loaded by any process on the machine, it gets a little bit trickier. Which of the above do you need ?

driis
The latter trickier case.
Jay Cincotta
+1  A: 

Here's an answer in PowerShell

if ( Get-Process | ? { $_.Modules | ? {$_.ModuleName -eq "AssemblyName.dll" } })
{
    "in use"
}
Scott Weinstein