missing namespace Cysharp

huangapple go评论97阅读模式
英文:

missing namespace Cysharp

问题

我有点困惑。有一个项目和其中的不同脚本。在其中一个脚本中,有一个对UniTask的依赖:

using System.Threading;
using Cysharp.Threading.Tasks;

而且它运行正常:

missing namespace Cysharp

但是创建了另一个脚本,现在我得到了缺少命名空间的错误:

missing namespace Cysharp

正如我们在第一个截图中所看到的:unitask已经导入了项目。

我已经尝试过的事情:通过VS重新构建解决方案,但没有帮助。

有什么建议吗?

英文:

I am a little confused. There is a project and different scripts in it. In one of the scripts, a dependency on UniTask:

using System.Threading;
using Cysharp.Threading.Tasks;

And it works fine:

missing namespace Cysharp

Created another script, but now i got missing namespace error:

missing namespace Cysharp

As we can see on 1st screenshot: unitask is imported in project.
What i have already done: rebuild solution via VS, but id didnt help.

Any advices please?

答案1

得分: 0

已解决为:

在VS中:项目 - 添加链接 - 项目 - 选中所有单元任务 - 确定

英文:

Solved as:

in VS: project - Add link - Project - check all unitask - OK

答案2

得分: 0

在Visual Studio中:项目 - 子文件夹引用 - 管理 NuGet 包 - 添加您的 UniTask 包。

例如:dotnet add package UniTask --version 2.3.3

英文:

In VS: project - sub folder References - Manage NuGet Packages - add your unitask packages.

for example: dotnet add package UniTask --version 2.3.3

huangapple
  • 本文由 发表于 2023年8月9日 15:50:25
  • 转载请务必保留本文链接:https://go.coder-hub.com/76865654-2.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定