views:

30

answers:

2

I'm development a Cmdlet and using Powershell-ISE to test. ISE is keeping my DLL locked and preventing from rebuilding and then reloading.

I've tried call remove ps-snappin, but the DLL remains locked.

+1  A: 

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 Hill
A: 

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.

Trevor Sullivan