Hi , I'm trying to execute C# code in Power Shell 2.0 . My problem is for the references at the beginning of the code: $code = @" using System; using System.Collections; using System.IO; using System.Linq; using System.Xml;<code></code> using System.Xml.Linq; public class Program { static void Main() { /* the code wich works*/ } } "@ Add-Type -TypeDefinition $code -Language "CSharpVersion3" Powershell gives me an error saying that " The type or namespace Linq doesn't exist" , and the same for Xml. I have Visual studio express 2013 . How can add or import correctly those references? or what is my error?
Add-Type -TypeDefinition $source -Language CSharp -ReferencedAssemblies System.Xml, System.Xml.Linq
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)