We created a chess game in which the actual engine is running on a separate thread. Everything works fine building the project for desktop, however building it for Windows Store results in the System.Threading namespace not being recognized. So I can build for a Windows 8(.1) desktop but can’t sell it on the Windows Store … hmmm.
Anyone any idea on how to get around this limitation? Do I miss something?
I already tried to change the engine to a coroutine approach but needless to say this is way too expensive as Unity and the chess engine are on the same thread.
Edit: Error message when building for Windows Store: Assets\Scripts\Engine\ChessEngine.cs(325,13): error CS0103: The name ‘ThreadPool’ does not exist in the current context
Hi,
I believe thread pool is located in another namespace on Windows Store Apps:
I’m completely lost converting the project to Windows Store 
I’m using the following code (snippets):
#if NETFX_CORE
using Windows.System.Threading;
#else
using System.Threading;
#endif
at the start of the script and following code:
#if !NETFX_CORE
myThinker = new Thread(new ThreadStart(Thinker));
myThinker.Start();
#else
IAsyncAction asyncAction = Windows.System.Threading.ThreadPool.RunASync((workItem) =>
{
Thinker();
});
m_workItem = asyncAction;
#endif
but apparently I’m missing something but I can’t pinpoint what exactly.
However building the project results into the following errors:
Assets\Scripts\Engine\ChessEngine.cs(328,13): error CS0246: The type or namespace name ‘IAsyncAction’ could not be found (are you missing a using directive or an assembly reference?)
Assets\Scripts\Engine\ChessEngine.cs(328,76): error CS0117: ‘Windows.System.Threading.ThreadPool’ does not contain a definition for ‘RunASync’
I’m trying to follow the example Microsoft provides at Quickstart: Submitting a work item to the thread pool (XAML) (Windows) | Microsoft Learn
Since IAsyncAction is in Windows.Foundation namespace, add “using Windows.Foundation;” under NETFX_CORE #ifdef.
As for run async, you’ve got a typo:
That it’s RunAsync :).
Thanks for pointing that out to me, I’m loving the CamelCase :).
Just downloaded the complete example repo http://code.msdn.microsoft.com/windowsapps/Windows-8-Modern-Style-App-Samples, looks like a great starting point for those taking there first steps into Windows Store development.