Search Unity

Unsupported project type in Visual Studio

Discussion in 'Editor & General Support' started by ghosttie, Apr 4, 2021.

  1. ghosttie

    ghosttie

    Joined:
    Nov 2, 2012
    Posts:
    4
    I just installed Unity Hub and Unity 2020.3.2f1 and I already had Visual Studio Community 2019 16.9.3 installed.

    I created a new Unity game, added a script, and when I double click it I get this error - it says the project type is unsupported:

    error.png

    It then tries to do a migration, which fails. If I try to use Visual Studio anyway, the project says it's incompatible, and there's no code completion or syntax highlighting:

    error2.png

    I've spent hours googling this issue and trying every solution I've found, and nothing makes any difference.

    Visual Studio Tools for Unity was already installed using Visual Studio Installer, but I tried uninstalling and reinstalling it, and it didn't help.

    In Edit - Preferences - External Tools, Visual Studio is selected, and I've tried browsing to the specific devenenv.exe, and nothing helped.

    I've tried deleting and recreating the .csproj and .sln files. I've tried deleting the .vs folder. I've tried clicking Regenerate project files.

    I've tried using Assets - Open C# Project.

    I've tried uninstalling and reinstalling the Visual Studio Editor package.

    At this point I've spent longer trying to figure this out than actually working on my game...
     
    Last edited: Apr 4, 2021
  2. arkman1231

    arkman1231

    Joined:
    Mar 8, 2012
    Posts:
    4
    Hitting the same issue, and tried the same solutions. No luck.
     
  3. ghosttie

    ghosttie

    Joined:
    Nov 2, 2012
    Posts:
    4
    In case this is a bug on the Visual Studio side I've reported it here so anyone else with the same problem can give it a vote
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,689
    Don't add files from Visual Studio. Create them from Unity. Visual Studio isn't a necessary part of anything in Unity land. You can edit source files with whatever you care to.

    Also, from Unity try Assets -> Open C# project.

    Also this standard stuff: This may help you with intellisense problems:

    https://forum.unity.com/threads/intellisense-not-working-with-visual-studio-fix.836599/

    Also, try update the VSCode package inside of Unity: Window -> Package Manager -> Search for Visual Studio Code Editor -> Press the Update button

    Also, this: https://forum.unity.com/threads/no-suggestions-in-vscode.955197/#post-6227874
     
  5. ghosttie

    ghosttie

    Joined:
    Nov 2, 2012
    Posts:
    4
    I didn't add files from Visual Studio, I created them in Unity, and Visual Studio is what I want to edit cs files with.

    I've tried all of the suggestions in that first thread and the second thread is irrelevant because it's for VS Code not VS.
     
  6. arkman1231

    arkman1231

    Joined:
    Mar 8, 2012
    Posts:
    4
    Yeah, absolutely nothing whatsoever to do with Intellisense. And we know VS is not “necessary”, we just really like it (and why wouldn’t you :)).

    Suspect this is a Project Guid issue of some kind, probably an easy fix, upvoted your issue in case that’s where the problem lies.
     
  7. ghosttie

    ghosttie

    Joined:
    Nov 2, 2012
    Posts:
    4
    Microsoft support was able to fix this!

     
    hpranjkovic and Chiaros like this.
  8. smourier

    smourier

    Joined:
    Sep 18, 2020
    Posts:
    1
    In my case, I have Visual Studio 2019 and Visual Studio 2022 both installed on my PC, and it only worked with Visual Studio 2022, never with Visual Studio 2019. Maybe the Visual Studio tools for Unity are not capable of being enabled in both version...
     
  9. TimGS

    TimGS

    Joined:
    Apr 24, 2014
    Posts:
    70
    I had the same problem with VS 2022.
    The thing that helped me was closing the project, deleting Library folder of the project and all csproj and sln files and reopening project to let it regenerate library and solution files