PowerShell: How do I open a reference without locking it?

I was recently writing a C# dll to the invoked in PowerShell. As I tested the PowerShell script, I found that the dll was being locked and any re-compiles from Visual Studio were being rejected.

I used the following code to resolve the problem:

$bytesCommon = [System.IO.File]::ReadAllBytes("c:\folder\driver.dll")
$loadResultCommon = [System.Reflection.Assembly]::Load($bytesCommon)

Comments

Popular posts from this blog

SharePoint 2013: Error updating managed account credentials

How can I call a JIRA api through Powershell?