Hi, I have just noticed that I get squiggly red lines even if I just create a plain C# script.

I have no idea what’s happening. It’s also the latest version of unity.
Hi, I have just noticed that I get squiggly red lines even if I just create a plain C# script.

I have no idea what’s happening. It’s also the latest version of unity.
It should show you a hint if you’ll point your cursor on the underlined symbol.
Yeah, but it never did this in earlier unity versions. Red squiggly lines usually mean there are errors in the script but as people that know how to script can see it is just a start script that has nothing I have added in it. All I did was right click and create C# script and gave it a name. Mind you I don’t code but I do know that this script doesn’t have any errors in it.
I tried an earlier version of unity which is 2017 4.8 and there are no squiggly red lines. Although this version of unity I have never had a problem with but later ones I have.
So what the hint says? It might be just code style warning or something like this.
It just says predefined ‘System.Void’ is not defined or imported. I have no idea what it means.
I have worked out this only happens to 2018 3.0f2 and 2018 3.1f1. No earlier versions of unity do this.
@wendymorrison It means you are missing the .NET SDK or target framework. Depending on your setup and used libraries download and install the versions from here (.NET core sdk+framework). Also close VS while installing and reopen once done.
One of .NET core 2.0, 4.7.0, 4.7.1 or 4.7.2 is likely missing. Update VS to get the framework as it is included in newer versions (as listed)
I have VS2017. So is there a newer one than that because it came with Unity 2018.3 and onwards.
It does not necessarily mean the framework is not installed, it may also happen when the project file is either corrupted, or in some cases, when an exported project has not yet been built.
The former can often be fixed by forcing Unity to re-create the solution and the linked projects. Deploying the project can help sometimes, too.
I encountered the latter multiple times in 2017.X when I exported an UWP project to a completely new location. In this specific case, it’s usually enough to build (or just deploy for the first time, which includes the build process) that project and everything will be refreshed + set up properly.
No, I got all the new ones but it still did the same thing.
Sorry didn’t get what you meant. It is a brand new project and I haven’t moved the project elsewhere. It hasn’t happened in unity 2017 but only in unity 2018.
Try the following:
Unity should then create the library folder upon opening. At the very last, open a script file.
If the errors aren’t gone after that, then it’s probably indeed missing some installation, or if you’re sure the SDKs / Frameworks (the ones that were mentioned earlier) are installed, it cannot find them for some reason.
@wendymorrison delete the library, csproj files, sln file and the obj folder. Then open it in unity.
All I had to do is find the installer and update it. I had trouble finding the installer so I found a video
that had the installer with it but also realized it was on my computer all along. So now it works via updating visual studio.
I have the same problem, red squiggly lines all over the place all of a sudden. Also the intellisense feature where it shows member functions, function parameters, auto completion, and all that dont work anymore.
Hi,
I had the same problem in unity 2019.1.7 on Mac - I solved it by changing api compatibility level from .NET standard 2.0 (which was set by default after installation) to .NET 4.x.
You can find this option in:
Edit> Project settings> Player
I had the same issue as wingedimagination with 2019.1.8 on Windows and it was solved by using the same method.
The best solution of this problem was to completely delete unity and visual studio from my mac computer and reinstall the version you need. Don’t forget to make copy of your project!
This has been bugging me for over a month; this fixed the problem (in Windows) right away.