开发者

C# - Windows Phone 7 SDK - math class

开发者 https://www.devze.com 2023-01-11 10:32 出处:网络
It seems that I cant use system.math class within the windows phone projects. I can\'t even add the mscorelib.dll manually (windows phone dlls are different than windows dlls)

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

Is there 开发者_JAVA技巧any way to use System.Math class within the windows phone SDK projects?


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?


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?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消