Home Ask Login Register

Developers Planet

Your answer is one click away!

pauzinho February 2016

When using C# code in powershell, what is the difference between CSharp and CSharpVersion3?

I'm trying to use a class that calls System.Enum.TryParse(). When I call the Add-Type and use -Language CSharpVersion3, I get a

'System.Enum' does not contain a definition for 'TryParse'

error but no such error when using -Language CSharp


Mathias R. Jessen February 2016

Version 3.0 of C# targets version 3.5 of the .NET Runtime[1].

Enum.TryParse() was introduced in version 4.0

[1]: Wikipedia has a nice language-to-framework version matrix

Post Status

Asked in February 2016
Viewed 3,785 times
Voted 11
Answered 1 times


Leave an answer

Quote of the day: live life