Hello, can someone help me i installed c# extension in my Visual Studio Code and it automatically installs me some weird extension named " .NET Install Tool for Extension Authors" and it giving me some weird errors with blue exclamation mark also i cant uninstall this extension until i uninstall c# extension.
[quote=wideeyenow_unity, post: 9195224, member: 5989798]
Microsoft Visual Studio
[/quote]
Luxaa is using Visual Studio Code. That’s a different product
~~ @ : This probably is a dependecy of the c# extension so it will always be installed with it. The way to resolve these is to fix the reported erros in your script, not uninstall the package.~~
That is simply not true. “Unused Start” or “Unused Update” methods aren’t errors in Unity scripts. They are used by the C++ side. The solution is to fix the unity installation and extension as I stated above.
The .NET install tool for extension authors is a dependency. Nothing you can do about that.
It is required apparently for just supporting C# in visual studio code.
I never liked visual studio code. Visual Studio worked fine and after I switched to Rider, I never really looked back.
As for the blue info icon messages they’re just information / suggestions of actions that you could do.
They’re not errors.
Removing an empty method is a suggestion. Why have the method in the first place if you don’t use it.
Making certain fields readonly is also normal. You’d often start out with your code as private as possible.
The default of a field or method is private. Only open up if you have to.
readonly is a keyword that protects you from setting a variable multiple times throughout its lifetime.
Often a List<T> is suggested to be readonly so you’re not creating new lists for no reason.
If you had a cached reference of that list somewhere else then it would not be the same list anymore.
When it is readonly you cannot set it to a new list, protecting you from a mistake to make a bug.
Some variables aren’t supposed to be changed throughout the lifetime.
Except the part about leaving Microsoft Visual Studio… those are fighting words, lol…
As far as marking a int/float readonly, I’ve never done this, as I also received suggestions on doing that as well. It may be a micro-optimization? Not sure, never benched-marked the nanoseconds on that before.
And as far as having open/not-used Start() or Update() in classes that run all the time, does chew up a small bit of performance, since it has to call to those functions. And if there’s nothing to call, it’s just wasted processes.
If those blue “problems” are just suggestions, there should be a way to tell it to ignore that type of suggestion. Or even a way to turn off suggestions entirely. I also thought that it wasn’t going to save or compile the code with those ridiculous errors, lol, so really had me scratching my head.
I’ve used Visual Studio a very long time. Tried Rider before whilst being in college, it was ok and faster than visual studio but a paid license. Though when in college I got Rider for free. But I didn’t want to heavily depend on it, in case I was done with college.
After years, a now ex colleague gave me the suggestion to try it again. Now I can’t go without.
My boss paid the license fees. After I left there, I now pay the subscription myself. It becomes cheaper after 2 years.
Please make sure you are using the latest VS Editor package 2.0.20 (which now supports VSCode as well), and the Unity extension in VSCode. We ship analyzers that will add Unity-specific diagnostics or remove general C# diagnostics that do not apply to Unity projects (like IDE0051). If you see them, you configuration is perhaps incomplete.