Still having issues on including InputSystem Library using Visual Studio 2022

As the topic says I have this issue where I am still getting error messages in Visual Studio 2022. Works just fine in unity but intellisense is angry at me and it gets annoying. I tried creating another file to see if it pulls InputSystem library, I tried regenerating project files, and I tried going down a verison of VS Editor in unity’s Package Manager.

Here is what I see in Visual Studio 2022 (Do note that it VS Code and VS 2022 are different in case some people are unaware)

I tried going back a version of Visual Studio Editor in package manger that usually works sometimes with VS Code but I never really have issues on VS 2022 before.

Hi,

Welcome to our community! :slight_smile:

Is the InputSystem package installed? See here.

If it is installed, please go to Edit > Preferences > External Tools and click “Regenerate project files”.

Did this fix it?


See also:

Yes, I have InputSystem package installed through packet manager.

I have tried doing Regenerating Project files before. I have also tried creating a new scripting file to see if it would pull that library into that file, I have tried restarting Unity, Opening Source files through unity (Open C# Project files), and going to a previous version of Visual Studio Editor. My project doesn’t have any errors but my IDE is giving me annoying errors telling me that it can not find the namespace or type doesn’t exist.

The new input system is also enabled, isn’t it? See the link I posted in my previous answer.

If it is enabled, close Unity and VS. Then go to your project folder and delete the *.csproj and *.sln files. Launch Unity again. Then double click on your script in Unity so Unity launches VS.

Did that work?


New Input System is enabled, I deleted all the files in the project folder that ended with .csproj and .sln but that did not change anything after I launched my project and open my script.

That’s really odd. Could you please fill out our form and send me your zipped project (without the Temp and Library folders)? Don’t forget to add a link to this thread.

When you are done, drop me a line here, so I can check our server. I’d like to take a look into your project. Maybe I’ll be able to recreate your problem on my computer.

I have sent the forum over. It was still big after removing the library and zipping the files so I had to remove some assets pack that I used from the asset store, things like textures and models for trees.

I’ve just downloaded and tested your project but was not able to see your problem.

Check if Unity.InputSystem is in your References list in VS. I looked for “input” because the list is quite long.

image

When I removed the reference, I got the same problem as you but when I restarted VS, the reference reappeared.

Have you already tried to remove the InputSystem package from the Package Manager and reinstall it?

I do see the reference in my reference list under Assembly-CSharp, I tried removing it and then relaunching the IDE again and still didn’t fix it. I tried reinstalling the package and that didn’t change anything either.

Very odd. :confused:

Make a backup of your project folder by duplicating it. Save the duplicated folder somewhere else, maybe on an USB stick. To save some free space, you could delete the Library and Temp folders in the backup folder.

Could you install a newer version of Unity, delete the Library in your project folder and import your project (not the backup) into the newer version? Maybe there is an internal problem with Unity in your case. On my machine, your project and code worked as expected. I use Unity 2022.


I’ve just found this potential solution. Check the extensions in VS.

I made sure that Visual Studio had Unity Extension installed and I made a copy of my project and made it use unity 2022.2.2f1 and I still get the error of not finding the Reference of InputSystem

I also wanted to point out this kind of issue has been happening for a long time. I am not sure if its the same issue for me on other computers, but I switched from VS Code to VS 2019/2022 when I first encounter this issue but was having issues with Unity.UI. When I switched from code to 2022 I was able to use that library without issues fine and I wasn’t getting any complaints from the software. I just tested just now switching to VS Code I was able to not have that issue now:

The errors that are being shown right now is just me typing Input to see if Intellisense is working and showing me that library from InputSystem is found.

Another thing I like to mention is I see this warning when using Visual Studio:
image

I fixed that issue by changing the file name of where I keep all these Lecture projects in but it didn’t help fix this other issue.

So I am able to by pass this issue by going with VS Code instead of using VS 2022. I tried to open with 2019 but don’t know where it is on my computer. But its little frustrating that I switched to VS 2022 because of this similar issue.

What you describe sounds as if reinstalling Windows and everything might be a good idea.

Regarding the path and folder names, make sure to have your project on your internal harddrive, not in the Desktop or another managed folder. Also make sure to use ASCII characters only in the entire path.

I am probably not gonna do that at the moment. In the mean time I guess Ill just use VS Code or stick with VS 2022 if need be.

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

Privacy & Terms