error CS2001: Source file :XXXXXXX.cs”could not be found.
| 标题 | | | --- | --- | | Unity版本| 2021.1.18f1c1| | VS版本| vs2022|
## 可能的触发方式 1. Unity单独运行并不会出错,当将VS附加到Unity的时候可能就会提示这个错误 2. 导入一个新的UnityPackage包的时候
## 参考文档 1. https://github.com/xamarin/xamarin-android/issues/1678 2. https://forum.unity.com/threads/error-cs2001-source-file-could-not-be-found.388066/ 3. https://forum.unity.com/threads/first-install-error-cs2001-source-file-could-not-be-found.21692/
## 解决方式 ### 方式一 1. 创建缺少的脚本的其中一个,如果过还报错就多创建几个, 2. 关闭VS, 3. 删除sln, 4. 打开VS, 5. 附加, 6. 运行, 7. 运行的时候删除脚本,就行了。
方式二
- 将路径换的短一些,可能是路径太长了
感谢
感谢: 1. blackjack 2. ** \ 在深夜提供支持。