latest posts

After doing some research last night, it looks as though there is limited C# support on the Intel Galileo when using Windows IoT (see my Intel Galileo and Windows IoT post for more information on both the Intel Galileo and Windows IoT) per this August 20th, 2014 post from Pete Brown. This got me thinking what exactly is supported?

Checking the usual folder for Microsoft .NET under c:\Windows\Microsoft.Net was non-existent, so I started poking around. Low and behold under the c:\Windows \System32\CoreCLR\v1.0 folder all of the CLR dlls live.

Windows IoT CoreCLR Dlls
In looking at the list, Pete Brown was correct, outside of the System namespace we've got 0 support, but we do have LINQ, XML Support, Collections and IO. What about adding in let's say System.Net.Http?

Trying a simple HttpClient test with the System.Net.Http copied unfortunately gave a System.BadImageFormatException:
[bash] Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.BadImageFormatException: Could not load file or assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (Exception from HRESULT: 0x80131058) ---> System.BadImageFormatException: Cannot load a reference assembly for execution. --- End of inner exception stack trace --- at winiottest.Program.Main(String[] args) --- End of inner exception stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at AppDomainManager.HostMain(Int32 argc, Char** argv, Char* assemblyToRun, Int32 flags) [/bash] So I got thinking of using the older WebClient with the following code block:

static void Main(string[] args) {
     using (var webClient = new WebClient()) {
     using (var stream = webClient.OpenRead(new Uri("http://jcbench.azurewebsites.net/api/CompareResults"))) {
     using (var streamReader = new StreamReader(stream)) {
     var result = streamReader.ReadToEnd(); var list = JsonConvert.DeserializeObject>(result); foreach (var item in list) {
     Console.WriteLine(item); }
}
}
}
}
]]>
However, I received a System.IO.FileNotFoundException:
[bash] Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified. at winiottest.Program.Main(String[] args) --- End of inner exception stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at AppDomainManager.HostMain(Int32 argc, Char** argv, Char* assemblyToRun, Int32 flags) [/bash] At this point, I thought well what exactly is supported in the System.Net namespace? So I copied over the System.ni.dll from the c$\Windows\System32\CoreCLR\v1.0 path and opened it in the Object Browser inside of Visual Studio 2013 only to see not a lot is implemented...

Windows IoT System Dll
So at this point I ran out of ideas as far as getting any sort of System.Net component in C# at this time. Crossing my fingers it is on the horizon as I have a few ideas I'd love to implement in C# as opposed to C++ with the Galileo board.