PenguinBlues
PenguinBlues

Reputation: 338

TryParse is not a member of System.Enum error in VB.NET

I checked out http://msdn.microsoft.com/en-us/library/dd783499.aspx?cs-save-lang=1&cs-lang=vb#code-snippet-1. It should exist.

EDIT: I tried it on vs2010 (different project, though), and it exists.

Upvotes: 3

Views: 668

Answers (2)

sloth
sloth

Reputation: 101042

Enum.TryParse was added with .Net Framework 4.0.

You can easily tell this by looking at the Other Versions drop down menu in the documentation or the version Information:

.NET Framework
Supported in: 4.5, 4
.NET Framework Client Profile
Supported in: 4
Portable Class Library
Supported in: Portable Class Library
.NET for Windows Store apps
Supported in: Windows 8

So probably you're using an older .Net Framework version.

Upvotes: 4

Carlos Landeras
Carlos Landeras

Reputation: 11063

Do you have System Import?

Imports System

If you are in Visual Studio 2010, make sure you are targeting .NET Framework 4.0

enter image description here

Upvotes: 2

Related Questions