When I tried to build and attach my visual studio debugger to Unity I got lots of
“CSC : error CS2001: Source file could not be found.” related to the new Package Manager.
It must be related to the new package manager, and when visual studio tries to locate some “embedded c# script” they could not be found.
Anybody encountered this issue and has found a fix or workaround for it?
I have the same exact thing happening with all of my projects I create in Unity 2018.2.0f2. A bunch of CS2001 errors for each file within each of the packages that are by default loaded in with the new package manager.
It does not seem to prevent me from writing scripts and running them in the Unity Editor but I can’t use Visual Studio to compile without getting 45 errors having to do with package files that Visual Studio can’t find/read.
I have tried removing the packages and re-adding them and also recreating projects. Seems to be a continuous issue for me. I guess I can live with it for the time being but it is hard to ignore 45 unrelated red X’s every time I try to build my scripts.
I had the same issue, but installing the latest version of Visual Studio Community 2017 fixed the problem for me !
I actually deleted all the .csproj and the .sln. Then after having installed the latest visual studio update, I reopened a script from the editor, and Unity properly recreated the .csprojs and the .sln with ONLY my project scripts.
(so 4 .csprojs and 1 .sln, but not the ton of unwanted packages .csproj it was generating before the visual studio update)
Confirm the issue. I download Text mesh Pro with Package Manager and I can use asset in editor, but VS 2017 can’t find any references to Text Mesh Pro scripts
Unity please fix this issue, or remove Packeg Manager from 2018 verision, thx.
So I discover the path to the cache (C:\Users(name of your account)\AppData\Local\Unity). Folks says to remove everything from there, but i just copy folders “Scripts” and “Test” from
C:\Users\ (name of your account) \AppData\Local\Unity\cache\packages\packages.unity.com\com.unity.textmeshpro@1.2.4;
and paste it to the corresponding project folder (\ProjectPath\Packages\com.unity.textmeshpro).
And it seems to work fine.
Since that i think that something goes wrong when Unity tried to check cache and accidentally concluded that files are already exists in project.
Deleting the cache didn’t work for me. I tried uninstalling Unity and installed 2018.2.5f1. That did not help. I upgraded from VS 2017 15.5.x to 15.8.1. That worked!
On Unity 2018.2.6f1, just upgraded to VS2017 community 15.8.2, deleted the solution and project files, reopened the c# project, but still the source files of the pacakge manger still are not found and cause CS2001 errors.
edit: deleting the library folder and every I could find, helped and it is now compiling
I was encountering this issue (Unity 2018.2, VS 15.5.4) and resolved it by creating an empty Assembly Definition at the top level of my scripts folder.
As an absolute beginner on this platform, I was disheartened because I couldn’t get going the very basic application.
Even with latest Unity Pro and VS2017 I got 46 errors and don’t understand where the problem is.
Please Microsoft do something about this!