- Home /
Unknown types with .NET 4.x and .NET 2.0 profile
Hello,
I decided to switch to scripting runtime .NET 4.x equivalent and the Standard 2.0 profile as a scripting compatibility because I'm working on an Android project. When the Standard 2.0 profile is used, Visual Studio gives me a lot (a lot) of errors:
CS 0518 Predefined type 'System.String (or System.Object or System. Void)' is not defined or imported.
All of the types (even those I defined) are also underlined in red. These errors disappear when I select the .NET 4.x scripting compatibility, but I can't use this because of the generated build size.
I searched a lot on Google about these errors but nothing helped me. Can someone have an idea of how to use this scripting compatibility?
Thank you in advance
have you tried deleting the visual studio files from your unity project folder and regenerated those by double clicking a script file in Editor?
Yes or course. I tried removing all the csproj and sln files, but it didn't work.
Answer by hexagonius · Oct 23, 2018 at 06:20 PM
this helping any:
https://forum.unity.com/threads/net-standard-2-0-support-is-completely-broken.519608/
Just a little question, is there any open issue about this?
Answer by hexagonius · Oct 23, 2018 at 06:20 PM
this helping any:
https://forum.unity.com/threads/net-standard-2-0-support-is-completely-broken.519608/
Thank you, I didn't found this when I googled the problem. But there is no solution for me, and I hope that the new version will have a real patch for this. Could you post this as a reply, I would be able to accept it.
Converted Hexagonius's comment to answer.
Your answer
Follow this Question
Related Questions
Cross-Platform Development Restrictions 1 Answer
Check API Compatibility Level 2 Answers
Must Change API for script to work? 0 Answers
How to use UnityWebRequest to upload a File via Invision REST API 0 Answers