TimeZoneInfo - why can't I instantiate?

I am trying to use the EWS API to access an Exchange server from a console program I am writing. I have specified the type of exchange server I am connecting to, but when I try to execute the code I have it gives me

Error 1 The type "System.TimeZoneInfo" is defined in an assembly that is not referenced. You have to add assembly reference 'System.Core, Version = 3.5.0.0, Culture = neutral, PublicKeyToken = b77a5c561934e089'. C: \ Documents and Settings \ jsorensen \ My Documents \ Visual Studio 2005 \ Projects \ ConsoleApplication2 \ ConsoleApplication2 \ Program.cs 26 13 ConsoleApplication2

Is Microsoft Visual Studio Academic Edition not TimeZoneInfo support, or is it a .Net version that XP may not be up-to-date enough to work with the EWS API? I am moderately new to C # programming, so some things are still confusing.

+2


a source to share


1 answer


Looking at your code, it looks like you are targeting .Net 2.0 and the TimeZoneInfo class is defined in .Net 3.5. See if you can upgrade your project to 3.5 and that should do it.



+2


a source







All Articles