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

查看:89
本文介绍了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、Visual Studio Tools for Unity 2.2.0.0 和 Visual Studio Community 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 中的附加到 Unity 调试器 会显示一个正确的 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 >关于还显示了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天全站免登陆