Runnin Framework 4.0 with Powershell

Posted by Mike Koerner on Geeks with Blogs See other posts from Geeks with Blogs or by Mike Koerner
Published on Thu, 31 May 2012 20:23:17 GMT Indexed on 2012/05/31 22:41 UTC
Read the original article Hit count: 176

Filed under:
I had problems running scripts with Framework 4.0 assemblies I created.  The error I was getting was 
 
Add-Type : Could not load file or assembly 'file:///C:\myDLL.dll' or one of its depend
encies. This assembly is built by a runtime newer than the currently loaded run
time and cannot be loaded.
 
I had to add the supported framework to the powershell.exe.config file.
<supportedRuntime version="v4.0.30319"/>

I still had a problem running the assembly so I had to recompile and set "Generate serialization Assembly" to off.

© Geeks with Blogs or respective owner