Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我如何判断一个程序集是否正在被任何进程使用?
这是PowerShell中的答案
if ( Get-Process | ? { $_.Modules | ? {$_.ModuleName -eq "AssemblyName.dll" } }) { "in use" }
如果您想知道您的应用程序是否已加载程序集,您可以检查 AppDomain 以查找已加载的程序集。如果您想知道程序集是否由机器上的任何进程加载,它会变得有点棘手。您需要以上哪一项?