15

Silverlight 4 added support for the dynamic keyword. Does Windows Phone 7 support also support it?

I am getting compile errors and have been unable to find any source on the web which says whether it is supported one way or the other.

The compile error:

The type or namespace name 'Dynamic' does not exist in the namespace 'System' (are you missing an assembly reference?)

James Newton-King
  • 48,174
  • 24
  • 109
  • 130
  • 2
    if you are getting compile errors, what are they? – Mitch Wheat Jan 03 '11 at 00:11
  • The CLR4 run-time is required. The `dynamic` keyword requires some DLR features which are *not* available on the CLR2 (.NET 2-3.5) run-time. See: http://stackoverflow.com/questions/4568452/dynamic-keyword-problem –  Jan 03 '11 at 01:06
  • I'm still getting the compile errors with Mango Beta 2. I thought for sure dynamic would be supported in this release. The funny thing is.... I can pass in to a dynamic argument, but I can't return one in a Method. Any thoughts? Thanks –  Jul 09 '11 at 21:57

1 Answers1

14

I believe WP7 targets .NET Framework 3.5, which means no dynamic keyword. If there is an eventual firmware update they might support .NET Framework 4.0 Client Profile, but don't quote me on that!

Matthew Abbott
  • 60,571
  • 9
  • 104
  • 129
  • This is correct. The CLR4 run-time is required. The `dynamic` keyword requires some DLR features which are *not* available on the CLR2 (.NET 2-3.5) run-time. See: http://stackoverflow.com/questions/4568452/dynamic-keyword-problem –  Jan 03 '11 at 01:04