Strange Interlocked behavior in wp7

I have a library, which was basically oriented on wp8.

I made new wp7 library and added all code there. There are lots of async/await, so i added:

  • MS Portability pack 1.1.3
  • MS Build components 1.0.10
  • MS Bcl Async 1.0.16

I also made new sample wp7 project and added library there, it works fine (no Bcl in project itself). Debugger shows that all async/await and Interlocked (!) works fine.


Now, i need to do more heavy tests. I'm tryig to add that library to my real app. My real app is using Bcl, same versions as library (reinstalled and checked manually). However, while running it, i'm getting NotSupportedException in line Interlocked.Add();

Any ideas, why this happens?

Jon Skeet
people
quotationmark

I assume you mean Interlocked.Add(ref long, long)? If so, the documentation isn't exactly blatant, but it does explain it:

Version Notes
Silverlight for Windows Phone
64-bit members of the Interlocked class are present but not supported.

... which precisely matched what you've seen.

people

See more on this question at Stackoverflow