简体   繁体   English

在安装Visual StudioTools for Unity之后找不到UnityEngine.UI命名空间

[英]Can't find UnityEngine.UI namespace after installing Visual StudioTools for Unity

I have been using Visual Studio 2015 community (version 14.0.25123.00 Update 2) with .Net framework v4.6.01038 with Unity Tools for VS2015 which I used to debug my unity projects. 我一直在将Visual Studio 2015社区(版本14.0.25123.00更新2)与带有用于VS2015的Unity工具的.Net框架v4.6.01038一起使用,该工具曾用于调试我的统一项目。 Everything seemed to work fine but after I tried to work with UnityEngine.UI VS start showing errors saying that the namespace can't be found. 一切似乎都正常,但是在我尝试使用UnityEngine.UI之后,VS开始显示错误,指出找不到命名空间。 I have used the exact same project files in to another pc where the only difference was in .Net framework version (v4.6.01055)and that worked. 我在另一台PC中使用了完全相同的项目文件,其中唯一的区别是.Net Framework版本(v4.6.01055),并且可以正常工作。 If I remove the unity tools from my previous pc, the build error goes away but I guess there is no way to debug without the unity tools. 如果我从以前的PC中删除了统一工具,构建错误就会消失,但是我想没有统一工具就无法调试。 Is this a issue with .net framework or I am missing something? .net框架是否有问题,或者我缺少什么? - I tried to export and re-import all unity assets and packages but that did not solve the issue - VS2015 was uninstalled and reinstalled from scratch - still did not work - unity tools was also reinstalled - Also deleted the projectFolder\\Library\\UnityAssemblies folder and restarted VS2005. -我尝试导出并重新导入所有unity资产和软件包,但是并不能解决问题-VS2015已卸载并从头开始重新安装-仍然无法正常工作-还重新安装了unity工具-还删除了projectFolder \\ Library \\ UnityAssemblies文件夹并重新启动VS2005。

None of these methods seems to work for me. 这些方法似乎都不适合我。 Tried to find the exact version of .net framework but failed too. 试图找到.net框架的确切版本,但也失败了。 Is there a specific solution to this problem? 是否有针对此问题的特定解决方案?

So I finally found a workaround of this issue and I pretty much think that the .Net framework version was not occurring any problem here. 因此,我终于找到了解决此问题的方法,并且我几乎认为.Net框架版本在这里没有发生任何问题。 The solution is to Setting the Api Compatibility Level from ".NET 2.0 Subset" to ".NET 2.0". 解决方案是将Api兼容性级别从“ .NET 2.0子集”设置为“ .NET 2.0”。 To do this in unity perform the following steps: 为此,请统一执行以下步骤:

Unity > Edit > Project Settings > Player > Api Compatibility Level Unity>编辑>项目设置>播放器> Api兼容级别

From: ".NET 2.0 Subset" To ".NET 2.0" 从:“。NET 2.0子集”到“ .NET 2.0”

Do perform a restart to both Unity and VS2015 (if the above solution doesn't work right then) 请同时执行Unity和VS2015的重启(如果上述解决方案无法正常运行)

Go to: Edit > Preference > External Tools. 转到:编辑>首选项>外部工具。 in External script editor > click on browse > go to unity file > Editor File and click on mono develop. 在外部脚本编辑器中>单击浏览>转到统一文件>编辑器文件,然后单击mono开发。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Unity3d 2019.3.10 UnityEngine.UI; 未找到 - Unity3d 2019.3.10 UnityEngine.UI; not found 即使安装了 Unity UI,UnityEngine.UI 也不属于我的项目。 我还能如何在运行时更改文本? - UnityEngine.UI is not part of my project even though Unity UI is installed. How else can I change text at runtime? 缺少 package UnityEngine.UI - missing the package UnityEngine.UI 无法加载Assembly UnityEngine.UI的文件,而且编辑器UI在运行时出现问题 - Could not load File of Assembly UnityEngine.UI, Also Editor UI has problems at runtime 由于保护级别而无法访问,并且无法将类型字符串完全转换为UnityEngine.UI - inaccessible due to protection level and cannot complicitly convert type string to UnityEngine.UI Unity 说“无法将浮点数转换为 UnityEngine.Vector3” - Unity says 'Can't convert float to UnityEngine.Vector3' Unity - 升级项目后,在命名空间“UnityEngine”中找不到类型名称“Rigidbody2D” - Unity - type name 'Rigidbody2D' could not be found in the namespace 'UnityEngine' after upgraded project Visual 2017 C#和Unity,无法引用Google名称空间,名称空间不会自动填充 - Visual 2017 C# and Unity, Can't refer to Google namespace, Namespace doesn't autofill Unity 中的命名空间“UnityEngine”中不存在类型或命名空间名称“Windows” - The type or namespace name `Windows' does not exist in the namespace `UnityEngine' in Unity Visual Studio 2017找不到命名空间系统 - Visual Studio 2017 can't find namespace System
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM