Hi,
we tried to use a script with System.Net.Http.HttpClientHandler, with the Unity Beta version. Which is a .Net4.5 feature.
We have been able to change the .Net Version in Unity but we cant access Solution Properties inside Visual Studio (Solution created by Unity). It says: “Resource not available for anonymous access. Client authentication required.”
When we now try over NuGet to import system.NET.Http it says always the project version is referencing “.NETFramework,Version=v3.5,Profile=Unity Subset v3.5” but the framework dont contain compatible assemplies.
How can we fix it? Which kind do we see wrong.
Best regards
Can you elaborate what you’re trying to do? Which platform are you targeting?
I try to target the hololens so UWP more or less.
Edit: Oh I just found the issue for the strange properties behaviour seems as if in the tools for unity setting is the property options disabled. Wasnt expecting this function.
It will try to change properties there to .NET 4.5 and test again.
But now visual studio and unity writes: feature `asynchronous functions’ cannot be used because it is not part of the C# 4.0 language specification
The import of HTTP Client and Newtonsoft json via NuGet worked well. But next error as above. Is there a reason that it writes wrong version. I read that unity beta supports C#6.0? Do I have to change it anywhere or is it another build?
No, Unity 5.6 beta does not support C# 6. There is a special version that supports C# 6 but its not Unity 5.6 beta. Look here and ask your C# 6 questions there.
Unity Editor only supports C# 4 and .NET 3.5. UWP/HoloLens, however, supports C# 6 and .NET Core 5 (on .NET scripting backend), .NET 3.5 (on IL2CPP scripting backend with 2.0 API compatibility level player setting) and .NET 4.6 (on IL2CPP with 4.6 API compatibility level player setting - this is new in 5.6). To use that, you need to wrap your scripts where you use that functionality in “#if UNITY_WINRT && !UNITY_EDITOR”/“#endif” so the editor does not complain.
1 Like
Ok thanks for the clarification I will try it.