Visual Studio调试器未附加到Unity [英] Visual Studio Debugger not attaching to Unity

查看:681
本文介绍了Visual Studio调试器未附加到Unity的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在将Visual Studio调试器附加到Unity时遇到问题-VS中的编辑和编译脚本工作正常-但是,当单击附加到Unity"或附加到Unity和播放"时,代码无法编译,但是没有任何编译否则发生.如果所有构建都是最新的,则该按钮完全不执行任何操作.我可以在Unity中手动启动游戏,它可以运行最新代码,但未附在VS调试器上.

I'm having issues getting Visual Studio's debugger to attach to Unity - editing and compiling scripts inside VS is working fine - however, when clicking "Attach to Unity" or "Attach to Unity and Play", the code compiles but nothing else happens. If all the builds are up-to-date then the button does nothing at all. I can manually start the game inside Unity and it runs the up-to-date code, but it is not attached to the VS debugger.

我在PC上安装了Unity 5.3.5,用于Unity 2.2.0.0的Visual Studio工具和Visual Studio社区2015.所有Unity工具都显示在Visual Studio内部(附加到Unity等).

I have Unity 5.3.5, Visual Studio Tools for Unity 2.2.0.0 and Visual Studio Community 2015 installed on my PC. All of the Unity tools appear inside Visual Studio (Attach To Unity, etc).

在VS中进入Tools > Attach To Unity Debugger会显示一个正确的Unity编辑器打开实例列表,但是选择一个并不会附加.按照建议的此处尝试使用127.0.0.1作为IP端点,但这仍然无法正常工作.我已经允许Unity和VS通过防火墙设置,但无济于事.

Going Tools > Attach To Unity Debugger inside VS brings up a correct list of open instances of Unity editor, but selecting one doesn't attach to it. As suggested here I've attempted using 127.0.0.1 as the IP endpoint, but that still didn't work. I've allowed both Unity and VS through the firewall settings, to no avail.

Unity的Help > About还会显示Visual Studio Tools For Unity版本号,因此它知道插件的存在.

Unity's Help > About also display's the Visual Studio Tools For Unity version number, so it is aware of the plugin's existence.

我通过devenv.exe /log加载了VS,以查看是否发生了任何奇怪的事情-日志看起来很好,并且Unity Tools正确地加载了. (如果有任何用处,请在此处).

I loaded up VS via devenv.exe /log to see if anything weird was happening - the log looked fine and that Unity Tools was loaded up properly. (The log is here if that is of any use.)

我已经在VS,Unity和VS Tools for Unity上完成了重新安装的修复,这很长很费力,但是什么也没改变.

I've done a repair reinstall on VS, Unity and VS Tools for Unity, which was long and arduous, but changed nothing.

我要让它工作起来真是疯了-按下"Attach To Unity"并看到它实际上什么也没做,甚至没有错误消息,实在令人沮丧.我觉得我一定想念一些东西-任何想法/建议/解决方案将不胜感激

I'm going mad trying to get it to work - it's really frustrating to press "Attach To Unity" and see it do literally nothing, not even an error message. I feel like I must be missing something - any ideas / suggestions / solutions would be greatly appreciated

推荐答案

这也杀死了我.在经历了过去几天安装的所有内容并进行了卸载和重新安装之后,我确定最新的Xamarin破坏了VSTU集成.我什至没有回复到VSTU 2.1.

This was killing me too. After going through everything installed in the last few days and uninstalling and reinstalling, I determined that the latest Xamarin broke VSTU integration. I even reverted to VSTU 2.1 to no avail.

只有卸载Xamarin,调试器才能附加到Unity.

Only uninstalling Xamarin allowed the debugger to attach to Unity.

因此,到目前为止,如果我们希望VS调试器连接到Unity,我们必须在Xamarin或VSTU上使用,但不能在同一台计算机上同时使用.

So for now, we have to use either Xamarin or VSTU, but not both on the same machine if we want the VS debugger to attach to Unity.

这篇关于Visual Studio调试器未附加到Unity的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆