Question

I am just beginning developing applications for Windows Phone 8, and I have a few questions about the different runtime environments that are running on such a device. I am probably not searching the web correctly as I am not able to find any answers that I fully understand or give the details I need (if you have any links, any sharing is much appreciated!).

1) Coming from the C++ and C# Desktop world, I'd really like to know what "kind" of native and CLR runtime are actually running on a Windows Phone 8 OS. For instance, the most common C++ runtime on desktops is the MSVCR the Visual C++ compiler links to, or the full-blown .NET framework CLR implementation many i.e. C# applications are referencing. A Windows CE system has it's mscorlib resp. the .NET Compact Framework. These things are totally clear for me.

But as far as I have gathered, a Windows Phone 8 OS runs on the WinRT and the CoreCLR (which I have only heared about when it comes to Silverlight somehow). Is this a correct statement?

2) If my first assumption is correct: I have a C# application which P/Invokes a native C++ DLL - the code for both of them is portable between Dekstop-Windows and WindowsCE (where the C++ DLL gets compiled for x86/x64/ARM, depending on the target system). Would I somehow be able to just "target" WP8 and run that application on such a device without severe code changes? Or must there be an extra port for WP8? Without knowing more about the runtime environment of the system, I really can't answer that question myself :(

I can't fully grasp the compatibilites and differences between all these worlds, especially as I don't really know much about WinRT/CoreCLR and whether they actually play a role in Windows Phone 8 or not. I am aware that these are all totally different technologies, don't worry, but I'd like to know where they all fit in the whole picture. Sometimes I feel overwhelmed by all the different frameworks and technologies Microsoft throws out there, I hope this is understandable.

Thanks for any answers!

Was it helpful?

Solution

Microsoft reveals very few details about the OS itself. Other than it being a trade-secret, it would be rather self-defeating since this evolves fast on mobile platforms. You should only focus on the api that's provided, this ensures that you'll get store certification and hope that your app still works on later phone editions.

WinRT is that api, along with a smattering but short list of native api functions. You'll indeed get the CoreCLR derived from Silverlight, a trimmed version of the desktop CLR. It includes the language projection that makes it easy to use WinRT from a managed app.

P/Invoke is not supported. It is not a problem in practice, other than portability, Phone8 supports developing native C++ libraries that expose their classes through WinRT. Usable from any language that you can use in a WinRT environment, like C#, VB.NET, C++ and Javascript. You'd start such a library by using the C++, Windows Phone, Windows Phone Runtime Component project template. You must otherwise observe the same api restrictions.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top