Having issue with visual studio library not working

hello sir please read this carefully I am having very strange issue with unity and visual studio and I spent almost 4 to 5 hours to fix this finding and searching online to find any solution and I tried everything.

My visual studio is not accepting any library related to unity. I want to add unity libraries like UI, cine-machine but its not accepting it and shows gray color if I add it.

I am attaching images and you can see.

Screenshot 2022-07-24 001621
Screenshot 2022-07-24 001713
Screenshot 2022-07-24 001746

what I did to solve this:

regenerate files many times but not worked
registry package files regenerate many time but not worked
restart my PC not worked
installed new unity version but not worked
I was using 2019 VS with 2022 although it not an issue but I thought to install 2022 version VS with 2022 unity but not worked.
then installed Visual studio code installed all extension required but not worked

I am lost I tried everything but did not work please help me its urgent. I want to access cine-machine library in the script to use its features to control camera functionalities through script but this issue is not solving.

Hi @abrar123,

Welcome to our community! :slight_smile:

Thanks for sharing so much information, especially on what you already tried to no avail. That’s helpful.

When you installted VS, did you follow this instruction?

By regenerating files, do you mean the “Regenerate project files” button in the Preferences?

If so, check if VS is still selected as your External Script Editor in Unity (Edit > Preferences > External Tools). Also check if the “Visual Studio Editor” package is installed in Unity (Window > Package Manager). Maybe there is an update.

Take a look at your console. Are there any error messages?

If nothing helped, you could try to close Unity and VS. Then delete the Library and Temp folders in your project folder. Restart Unity. That might take a couple of seconds. Open your scene.

If that did not fix it either, please let me know in which course and lecture you are.


See also:

Thanks for your concern but I already fix that issue what I did was I deleted all the assembly files in he project main project files “.sln” “.cspro” and hidden folder of VS “.VS” everything that linked with VS then I restart the project and its automatically recreated those files and that fixed it.

Good job! :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms