Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Visual Studio fails build with no errors listed

Discussion in 'Editor & General Support' started by dgoyette, Jun 14, 2019.

  1. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,211
    I'm not sure when this started happening, but I suspect it's some time in the last few days, given how noticeable an annoying the behavior is.

    In Visual Studio 2019, build errors are only shown in the Errors window if the specific C# files containing the errors are open in Visual Studio. If I close the files, and build, Visual Studio will tell me the build failed, but it won't list the errors. Sometimes it gives me a single global error referring to Assembly-CSharp, but not for the specific errors.

    For example, here's Visual Studio showing me a compiler error in the script I have open:

    upload_2019-6-14_12-30-9.png

    But if I close that script and build again, I get this instead:


    upload_2019-6-14_12-30-42.png

    I've restarted VS/Unity/Windows, with no change to the behavior. I've tested this in a new project in 2019.3, .4, and .6, and the behavior is the same. I'm not sure if this is an issue with VS Tools for Unity, or how such an issue could be reported to them. It doesn't seem there's any way to downgrade to an earlier version of VS Tools for Unity to test out whether this is a recent regression.

    Has anyone experienced this? Like I said, this is easily reproduced creating a brand new project in various versions of Unity, so I don't believe it's a specific issue with my project.
     
    Cambesa likes this.
  2. tsibiski

    tsibiski

    Joined:
    Jul 11, 2016
    Posts:
    614
    So, the metadata file issue is a Visual Studio issue. Not a Unity issue. This happens a lot in certain projects, at least in my experience. If using a PC, go to %APPDATA%\Roaming\Microsoft\Visual Studio and delete the contents. This has fixed this issue 99% of the time for me. If on a Mac, go to /Users/YOU/Library/ and find the cached Visual Studio files and remove them.

    Next, go to Build > Clean in VS. Then rebuild.
     
    ALaramee likes this.
  3. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,211
    Good suggestion, but unfortunately that doesn't change the behavior. I deleted the AppData content and restarted, but it's still the same behavior. There's no "Clean" under Build, but I've tried building and rebuilding, but it's just the same. I've also tried toggling various settings in the VS Tools for Unity options window, but nothing affects the behavior.
     
  4. tsibiski

    tsibiski

    Joined:
    Jul 11, 2016
    Posts:
    614
    Just to confirm, so I can save time on investigating. You are on a Mac, right? Not PC?
     
  5. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,211
    No, I'm using Windows 10. I'm going to just uninstall VS and reinstall, and see if that helps.
     
  6. tsibiski

    tsibiski

    Joined:
    Jul 11, 2016
    Posts:
    614
    Very interesting. I was confused because you said that you didn't have a "Clean" option under the "Build" header/dropdown. If that isn't there, there is something very weird/wrong with your Visual Studios.
     
  7. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,211
    A full reinstall didn't resolve the issue. However, looking in the VS Tools for Unity, I saw the following:

    upload_2019-6-14_15-0-2.png

    That "Disable the full build of projects" defaults to True, and I believe it was True before I reinstalled as well. I set it to False, and now I'm getting the error messages I expect to get. This setting wasn't there in earlier versions of Visual Studio Tools for Unity. I don't know if it's brand new, but it seems like maybe it's a new feature that isn't quite working correctly.

    In any case, setting it to False resolves my issue, for now.


    If I create a plain old Console app, I'll see Clean... in the Build menu. But not in my Unity project:

    upload_2019-6-14_15-3-10.png

    Probably something about how it's not a real solution in the Visual Studio sense of the term.