views:

99

answers:

3

Hi

It seems that I cant use system.math class within the windows phone projects... I cant even add the mscorelib.dll manually (windows phone dlls are different than windows dlls)

Is there any way to use System.Math class within the windows phone SDK projects?

Thanks.

A: 

You get the Silverlight (Windows Phone version) CLR, so trying to add mscorlib from the normal CLR won't work - you need the mscorlib.dll specific to that CLR as the assembly structure is different.

It's inside my mscorlib however, have you tried re-adding the reference, or closing Visual Studio?

Chris S
Yeah tried that.. didnt work.
Tring
+2  A: 

I've just tried and it works fine for me. I didn't need to do anything special or add any references, just the normal using System; and then (say):

decimal m = 10.6m;
m = Math.Round(m);

What happens when you try that?

Jon Skeet
Yeaqh thanks .. worked for me too.
Tring
A: 

Try manually editing the .csproj file . It happens when you try to open projects that were built on nonbeta builds on a machine with beta build of the SDK.

Try adding this to the project file

SudheerKovalam