Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Could not load file or assembly 'PresentationCore'

$
0
0

I've written a PowerShell script that copies an Excel range to the clipboard and exports it as an image. When I come to run it in Windows 7 with .net 4.5 it's fine, but it doesn't work in Server 2008 R2 with .net 2.0. I've upgraded .net to from 2.0 to 4.0 (3.0 required for PresentationCore) and it's still giving me the error below:

Add-Type:Couldnot load file or assembly 'PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyTok
ad364e35'or one of its dependencies.The system cannot find the file specified.At C:\scripts\myscript.ps1:10char:9+Add-Type<<<<-AssemblyPresentationCore+CategoryInfo:NotSpecified:(:)[Add-Type],FileNotFoundException+FullyQualifiedErrorId:System.IO.FileNotFoundException,Microsoft.PowerShell.Commands.AddTypeCommand

So I've upgraded .net but do I have to enable it or activate something for example?
Thanks in advance

Viewing all articles
Browse latest Browse all 6937

Latest Images

Trending Articles



Latest Images