Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
7
Question by Fainted · Jan 20, 2016 at 06:37 PM · unity 5editorpluginvisual studioattachment

Visual studio can't attach to unity editor.

When debugging I would like to attach to Unity and cycle through my breakpoints, however the "Attach to unity" button is replaced with "Start" and I can't seem to fix this.

I've gone so far as to delete my personal VS and old Unity to install the latest bundle where Unity comes with VS 2015 community as the requested feature should be available out of the box, but to no avail. What can I do to fix this? It would mean a ton!

Thanks in advance.

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Fainted · Jan 20, 2016 at 06:17 PM 1
Share

Okay, I figured it out. So for all of you experiencing the same issue, here is the solution that solved it for me:

Open the folder that holds your entire unity project and delete everything except the "Assets" and "Project settings" folders.

If it worked for you, leave a comment so others can find it easily!

avatar image vinibotto · Sep 13, 2016 at 06:18 PM 0
Share

It worked for me here! I closed the application, deleted all the files on my project except for Assets and Project Settings, and when I opened my project again the "Attach to unity" option was available. Thanks a lot!

7 Replies

· Add your reply
  • Sort: 
avatar image
9

Answer by crare · Jan 07, 2018 at 12:25 PM

Those didn't work for me so I found answer in forums. I am using Visual Studio 2017 so for some reason it wasn't already installed for me. To install Tools for Unity in VS:

Close Unity just to be sure nothing goes wrong. in Visual studio -> Tools -> Tools and Features..

New window pops up. Scroll down on tab "Workloads" to section "Mobile & Gaming" and you find "Game development with Unity". Check the checkmark and click "Modify" in the bottom right corner of that window.

This will then ask about VS processes running, click "continue" and it closes your VS-windows and continues installing the Tool you need. after it's done your Visual studio editor comes back.

Close VS, Open Unity and double click script to open it in VS(If you have it setup as editor in Unity preferences[Edit->Preferences->External Tools->External Script Editor -> set it to Visual Studio]).

Now you should see "Attach to Unity".

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
2

Answer by alok-kr-029 · Jun 05, 2017 at 08:02 AM

To solve this issue go to C ->Program Files->Unity->Editor and rename the unity exe file to "Unity.exe " remove the version extension if any

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image tylerlindell · Aug 17, 2017 at 12:55 PM 0
Share

this almost worked perfectly fro me. I had to use Unity without the .exe and I had to restart my machine to make it work correctly. Thank you for putting me on the right path.

avatar image
1

Answer by itaielidan · Dec 06, 2018 at 10:13 PM

What worked for me is to update visual studio. Go to Tools>Get Tools And Features...>Modify>Update

All done!

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by _raj9 · Jun 29, 2016 at 05:31 PM

I had a similar issue. Installing the latest version of VS tools for unity fixed that.

https://visualstudiogallery.msdn.microsoft.com/8d26236e-4a64-4d64-8486-7df95156aba9

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image zoomzang · Jun 02, 2017 at 11:33 PM 0
Share

@_raj9 do you know the link to download the latest tools for VS 2017

avatar image _raj9 zoomzang · Jun 05, 2017 at 03:14 AM 0
Share

https://marketplace.visualstudio.com/items?itemName=SebastienLebreton.VisualStudio2015ToolsforUnity

avatar image
0

Answer by Valhalaru · Aug 20, 2020 at 09:48 PM

These worked for me -

Debugging Unity on a Mac with Visual Studio (steps may work for a PC too)


Setup:

a. In Unity make sure VS is set in Unity->Preferences->External Tools - External Script Editor set to VS

b. In VS - Install the latest Unity Tools for Visual Studio (Game Development with Unity).

c. Click a script in Unity to Open VS


Steps:

  1. In Unity goto Unity->Preferences->General - set Code Optimization on Startup to “Debug”

  2. In Unity goto File->Build Settings

  3. Change Run in Xcode as to Release or Debug (the change resets it in VS)

  4. You should see the PLAY button in VS with “Attach to Unity” as one of the options


  5. (If that doesn’t work, do this:) Simply close VS and in Unity > Edit > Preferences > External Tools - Click on "Regenerate project files" (you don't need to check anything else, just click the button)

  6. Start VS again by clicking a script should be able to see the "Attach to Unity" option


Alternative to Attach Button on PC

1. In VS - goto Debug->Attach Unity Debugger-> ...select the Unity Process running your project.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
  • 1
  • 2
  • ›

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

14 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to fix: !CreateDirectoryRecursive(fullpath) 6 Answers

Unity doesn't open 3 Answers

Coroutine works in editor, but not in build Windows application 0 Answers

Why is my managed plugin not being referenced. 1 Answer

Editor crashes on second play 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges