Right-click the reference to the DotNetNuke.dll and click properties. Make sure the path is pointing to the DNN 3.1 DLL and not the older version. I've seen Studio reference an old DNN dll even after adding the new Dll reference due to the Reference Path's in your projects properties dialog box.
Chris Onyak
www.OnyakTech.com