i don’t know what i have to do? When I click it, it doesn’t create the c # script for me
What have you done to your Unity install? I suspect it’s been broken somehow, it should be right click in the asset folder > create > C# Script you seem to have that option missing.
I am actually having the same problem, had some issues with uninstalling & reinstalling unity with my antivirus… . After creating a class in Visual Studio, I get an error saying the file *.csproj is missing. I looked at similar threads that had this error, but did not found anything helpful.
Is there any way to reinstall the c# script extension for unity (I already tried regenerating the project files, with all options active) ?
There’s zero requirement for editing in Visual Studio. It’s just nice when it works. You can actually edit all the source files with ANY editor. Unity compiles it internally.
You also do not need to make a csproj because Unity doesn’t care and it will just wipe it out next time you open a C# file from Unity.
All that said, you definitely have something wrong with your install. There is no “C# extension,” but there’s a bunch of cruft-ware required to keep Visual Studio happy, and this is all I know about it:
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.
https://discussions.unity.com/t/778503
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://discussions.unity.com/t/805330/7
Thanks for the extra info, I used VS Code to create an default class from scratch and it worked!
You were right about not needing the csproj file.
I still can’t seem to create it from the Unity Editor itself, but this solution is enough to get me going.
The Unity editor used to have a script template folder where the actual script template(s) were stored. I haven’t checked that folder for years. A lot has changed since then since UnityScript and Boo support has been dropped. Also the path may be different depending on if you’re using the Unity hub or not. If the templates are missing, you should reinstall Unity because if they are missing, chances are high that other important files may be missing as well.
Maybe you installed it manualy in a dodgy location? Keep in mind that installing Unity in a too deep nested folder could cause issues because on windows the max path length is 240 characters. Also make sure you don’t have some file permissions issue.
I was working on 2 diferent projects, a 3d one (the main) and a 2d one (for fun)! In the 3d one, I was able to create a C# script but on the 2d one, I couldn’t! I have no idea what could be the issue (also i realised i posted this 4 years later lol)
Make sure you have Microsoft Visual Studio Community.
If the right click asset folder > Create > C# Script
doesn’t works,
try this:
Instead of C# Script option, Create > Scripting > Empty C# Script
tengo el mismo problema ya hice todo lo que dice en comentarioas lo de window, tambien lo de edit y preferencias y sigo presentando el mismo problema ya lo borre y lo intale junto con visual studio no se que puede estar pasando ahora

