Hello
We have an issue when building for UWP - ARM32 (Hololens2)
We have a dll with async functions like this:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace TestClassLib
{
public class TestClass1
{
private readonly HttpClient _httpClient = new HttpClient();
public async Task<int> GetDotNetCountAsync()
{
// Suspends GetDotNetCount() to allow the caller (the web server)
// to accept another request, rather than blocking on this one.
var html = await _httpClient.GetStringAsync("https://dotnetfoundation.org");
return Regex.Matches(html, @"\.NET").Count;
}
public int GetDotNetCount()
{
return GetDotNetCountAsync().Result;
}
}
}
It’s compiled for ARM 32/Release. In an unity script if we call the synchrone function everythings works, but if we await on the async function over the dll boundary the build breaks.
#if UNITY_WSA && !UNITY_EDITOR
TestClass1 t = new TestClass1();
int n = t.GetDotNetCount(); //this works
int n2 = await t.GetDotNetCountAsync(); //this breaks the build
#endif
Build error is error CS1705: Assembly ‘ClassLib’ with identity ‘ClassLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’ uses ‘System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ which has a higher version than referenced assembly ‘System.Runtime’ with identity ‘System.Runtime, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’
Any clue would be welcome. Thanks for reading