How to get Powershell-ISE to release Cmdlet DLL
I'm development a Cmdlet and using Powershell-ISE to test. ISE is keeping my DLL locked and preventing from rebuilding and then r开发者_如何学JAVAeloading.
I've tried call remove ps-snappin, but the DLL remains locked.
As Roman points out, this can't be done AFAICT. It isn't a PowerShell ISE issue as much as it is a .NET issue with assembly loading i.e. .NET doesn't support assembly unloading. It would be nice if there was a way to add the snapin via a secondary AppDomain and then unload that whole AppDomain. I'm not aware of any such attempt to do this in a host.
Keith and Roman are correct. Once you've loaded a .NET assembly into an AppDomain, the only way to release it is to close the AppDomain.
精彩评论