How to fix VS

ok I have unity tools
9095509--1260331--upload_2023-6-21_14-29-8.png
i have the external editor set


however, the fount is not changing for “using UnityEngine.UI;” or “’ public Slider[ ] val;” and the auto fill is not finding them ether
9095509--1260337--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)

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:

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

Also, this: No suggestions in Vscode

“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 ?

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.

found all but userprefs

no luck… is there a different (reliable compiler to try ?

huh
should i see some progress bar when clicking regenerate ?
that possess might be getting cut sort
9097540--1260751--upload_2023-6-22_9-0-38.png

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.

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)

“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 ?

ok?
so it is effecting “some” of the scripts ?
9099328--1261003--upload_2023-6-22_20-54-46.png9099328--1261006--upload_2023-6-22_20-55-32.png
I am totally lost now

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

9100474--1261213--upload_2023-6-23_9-37-5.png9100474--1261219--upload_2023-6-23_9-39-34.png

9100474--1261213--upload_2023-6-23_9-37-5.png

This is the wrong forum. I’ll move your post to the correct IDE forum.

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.

oh thanks

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)

would i want to copy any thing else ?
or remove something ?
9102907--1261759--upload_2023-6-24_17-53-58.png
ether way exerting / importing a package seems to be messing with assets (braking them)

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 ?

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
9102979--1261765--upload_2023-6-24_19-29-27.png
the settings gear in package manager seems to be missing

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 ?

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