Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Unable to create new project due to compiler error

Discussion in 'Windows' started by WiseKun, Feb 6, 2022.

  1. WiseKun

    WiseKun

    Joined:
    Jun 8, 2020
    Posts:
    4
    Hi there. I've been experiencing a weird problem on Unity and I don't know how to fix this problem. I would call myself a beginner/intermediate user. After searching the internet and trying all the possible solutions I could come up with, I've been unable to fix this. Any help would be highly appreciated. Thank you.

    I opened a previous project in Unity yesterday and it asked me to enter safe mode as shown in the image below.

    upload_2022-2-6_12-34-54.png

    I ignored it because I didn't have any errors before so I thought this was just a bug or something. Later, VS Code wouldn't open when I double-clicked on scripts in the project folders in Unity. Also, when I tried clicking "Play", an error said, "All compiler errors have to be fixed before you can enter playmode!". In the console, 2 blank errors came up as shown.

    upload_2022-2-6_12-40-36.png

    In the editor logs I can see the following but I don't understand them:

    Native extension for WindowsStandalone target not found

    and

    -----CompilerOutput:-stdout--exitcode: 1--compilationhadfailure: True--outfile: Temp/UnityEngine.TestRunner.dll
    -----EndCompilerOutput---------------

    and

    -----CompilerOutput:-stdout--exitcode: 1--compilationhadfailure: True--outfile: Temp/UnityEngine.UI.dll
    -----EndCompilerOutput---------------


    I have tried:
    • Reinstalling VS Code
    • Reinstalling Unity
    • Creating a new project
    When I create a new project, I experience the same problem. However, if I try to edit a project that I used before the original project that I mentioned, everything works perfectly fine.

    My Unity version is 2020.3.25f1
    I am using Windows 10.

    Any help will be highly appreciated, thank you.
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,518
    Can you send me the full editor log?
     
  3. WiseKun

    WiseKun

    Joined:
    Jun 8, 2020
    Posts:
    4
    I've attached it. Thank you.
     

    Attached Files:

    • log.txt
      File size:
      103.3 KB
      Views:
      183
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,518
    Can you try running "C:\Program Files\Unity 2020.3.25f1\Editor\Data\Tools\RoslynScripts\unity_csc.bat" via the command prompt and see what happens? Does it print anything?
     
  5. WiseKun

    WiseKun

    Joined:
    Jun 8, 2020
    Posts:
    4
    Hi there. I fixed the problem and found a solution. I will try to make a step of solutions for people that may experience this problem in the future. With your help, I found out that my command prompt wasn't opening when I tried to open it. I'm not sure which of these steps, in particular, solved it, but it worked:
    1. Open environment variables and add "C:\Windows\SysWOW64" to the path variable if not already there.
    2. Open PowerShell as administrator and do
      sfc /scannow
    3. Windows + R and type "regedit". Open HKEY_CURRENT_USER --> SOFTWARE --> Microsoft --> Command Processor and delete "AutoRun"
    4. Restart and it should work.
    Thank you.
     
    TomTorato and Jamolbek1 like this.