Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Question How to fix VS

Discussion in 'Code Editors & IDEs' started by CRISTALSONIC, Jun 21, 2023.

  1. CRISTALSONIC

    CRISTALSONIC

    Joined:
    Sep 22, 2016
    Posts:
    136
    ok I have unity tools
    upload_2023-6-21_14-29-8.png
    i have the external editor set
    upload_2023-6-21_14-30-3.png
    however, the fount is not changing for "using UnityEngine.UI;" or "' public Slider[] val;" and the auto fill is not finding them ether
    upload_2023-6-21_14-30-59.png
    not sure what broke.
    any one know were i should look to fix VS ?
    (using VS 2022 and unity 2022)
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    39,571
    This may help you with intellisense and possibly other Visual Studio integration problems:

    Sometimes the fix is as simple as doing Assets -> Open C# Project from Unity. Other times it requires more.

    Other times it requires you also nuke the userprefs and .vsconfig and other crufty low-value high-hassle files that Visual Studio tends to slowly damage over time, then try the above trick.

    Barring all that, move on to other ideas:

    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
     
  3. CRISTALSONIC

    CRISTALSONIC

    Joined:
    Sep 22, 2016
    Posts:
    136
    "Other times it requires you also nuke the userprefs and .vsconfig and other crufty low-value high-hassle files that Visual Studio tends to slowly damage over time, then try the above trick."

    that is looking to be the case, I guess i want to delete the files with unity closed and let the editor remake them when opening the project ?

    were would i find them ?
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    39,571
    Those files, if they exist, should all be at the root of the project, next to the .csproj files.

    Lately there has been a hidden folder
    .vs
    , so that's another place to look for microcruft.
     
  5. CRISTALSONIC

    CRISTALSONIC

    Joined:
    Sep 22, 2016
    Posts:
    136
    found all but userprefs

    no luck.... is there a different (reliable compiler to try ?
     
  6. CRISTALSONIC

    CRISTALSONIC

    Joined:
    Sep 22, 2016
    Posts:
    136
    huh
    should i see some progress bar when clicking regenerate ?
    that possess might be getting cut sort
    upload_2023-6-22_9-0-38.png
     
  7. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    39,571
    It's not a compiler to you in the Unity context.

    VS is just an annoyingly slow and finicky text editor as far as Unity is concerned.

    You CAN edit all your files with Notepad if you want.

    Only Unity matters. It does the compilation.
     
  8. CRISTALSONIC

    CRISTALSONIC

    Joined:
    Sep 22, 2016
    Posts:
    136
    lol no to note pad, I still want convenance futures like right clicking a object and selecting "go to definition" to jump to the CS file with the script

    that said i can open new project to find VS is just fine, so my problem is pacific to my project
    (if that helps narrow down things to try)
     
  9. CRISTALSONIC

    CRISTALSONIC

    Joined:
    Sep 22, 2016
    Posts:
    136
    "The .sln and .csproj files in the root project folder can also safely be deleted" is there any thing else I can safely be delete that i missed ?
     
  10. CRISTALSONIC

    CRISTALSONIC

    Joined:
    Sep 22, 2016
    Posts:
    136
    ok?
    so it is effecting "some" of the scripts ?
    upload_2023-6-22_20-54-46.png upload_2023-6-22_20-55-32.png
    I am totally lost now
     
  11. CRISTALSONIC

    CRISTALSONIC

    Joined:
    Sep 22, 2016
    Posts:
    136
    well now i know the problem is constant with any new script i make, but all old scripts are fine
    notice start is not recognized on the new script I don't know how to fix this

    can any one point me in the right direction


    upload_2023-6-23_9-37-12.png upload_2023-6-23_9-39-34.png
     

    Attached Files:

  12. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,761
    This is the wrong forum. I'll move your post to the correct IDE forum.
     
  13. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,937
    Once the solutions linked to by @Kurt-Dekker have failed you're largely in uncharted territory. If you haven't tried it already I'd delete the Library folder. If that fails and you're using version control you could try checking out previous versions until you reach the most recent functioning one and determine what changed.

    You mentioned that new projects work so if none of that works or if you're not using version control the worst case solution would be to export the assets from your project and import them into a new project.
     
    Last edited: Jun 24, 2023
  14. CRISTALSONIC

    CRISTALSONIC

    Joined:
    Sep 22, 2016
    Posts:
    136
    oh thanks
     
  15. CRISTALSONIC

    CRISTALSONIC

    Joined:
    Sep 22, 2016
    Posts:
    136
    those parts I tried, moving them almost seemed to work but i may have moved too much as it stoped after the fact

    i my double check that soon, maybe import my stuff as a package instead of using file explorer

    I am using version control with plastic but i went a while with out looking at scripts so that could set me back a lot

    one thing I thought about is that I had this project as a 2019 project that was updated to 2022. looking at that it is likely that any script i made in 2019 works and any new script made in 2022 is messed up.

    could this be a bug?

    (exporting a package now for testing that)
     
  16. CRISTALSONIC

    CRISTALSONIC

    Joined:
    Sep 22, 2016
    Posts:
    136
    would i want to copy any thing else ?
    or remove something ?
    upload_2023-6-24_17-53-58.png
    ether way exerting / importing a package seems to be messing with assets (braking them)
     
  17. CRISTALSONIC

    CRISTALSONIC

    Joined:
    Sep 22, 2016
    Posts:
    136
    yeah so it creates new scrips correctly until i copy those 3 folders and let the editor generate the rest

    so were would i look for something in these folders that would case the problem ?
     
  18. CRISTALSONIC

    CRISTALSONIC

    Joined:
    Sep 22, 2016
    Posts:
    136
    im going to try to only copy assets folder , but one of my assets uses jobs

    so how do i enable experimental packages in 2022
    upload_2023-6-24_19-29-27.png
    the settings gear in package manager seems to be missing
     
  19. CRISTALSONIC

    CRISTALSONIC

    Joined:
    Sep 22, 2016
    Posts:
    136
    ok after a lot of trial and error I determined that its the project settings folder that brakes the scripts .

    if I copy assets and packages im good, but VS stops working when project settings is carried over.

    to any one who would know is can project settings be deleted and regenerated safely ?

    or is there a way for me to revert just that folder over plastic ?
     
  20. CRISTALSONIC

    CRISTALSONIC

    Joined:
    Sep 22, 2016
    Posts:
    136
    after a lot of testing I found the culprit !

    • so start a new project in 2022 (VS works)
    • I copy assets and packages (VS works)
    • one asset requires project setting import, import fails due to searching the file path of the original project.
    • so I re import that from the package manager (VS works)
    • then I import its project settings replacing 3 files it successfully imports (VS stops working)

    so yeah i don't know what would brake the link to VS in those files (I dint remember what they are called now lol )
    but now I know were the heart of the problem is, I will contact the asset creator and see if we can fix the problem in the original project (so i do not have to reset up plastic lol)

    thanks every one
     
  21. CRISTALSONIC

    CRISTALSONIC

    Joined:
    Sep 22, 2016
    Posts:
    136
    well no progress has been made, I been at this mor a month now .
    is there some one from unity support who I can send the full project and just remove assets I'm not allowed to share such as my characters and such. so would they would be able to take a closer look at it ?

    I put in a support ticket the day i started this tread and have got no reply