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
2008-10-09 18:44:47
The latter trickier case.
Jay Cincotta
2008-10-09 18:45:43
+1
A:
Here's an answer in PowerShell
if ( Get-Process | ? { $_.Modules | ? {$_.ModuleName -eq "AssemblyName.dll" } })
{
"in use"
}
Scott Weinstein
2009-07-06 20:21:08