[英]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.