.NET Micro Framework Unsafe code

2019-07-14 03:24发布

问题:

Does .NET Micro Framework support unsafe code? In other words, can I use pointers in my code for .NET Micro Framework?

回答1:

From the Wikipedia page (emphasis mine):

For example, the platform does not support symmetric multiprocessing, multi-dimensional arrays, machine-dependent types, or unsafe instructions.

The technical white paper lists it in the omitted features too.



回答2:

Although officially not supported, I have personally used and tested unsafe code in NETMF 4.2 and find that it works as expected.

Another developer provides sample code for implementing a BitConverter class on NETMF doing just this:

http://forums.netduino.com/index.php?/topic/308-bitconverter/