Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
0
Question by Johan 2 · Feb 25, 2011 at 03:00 AM · dllexternaldebugger

Does Unity 3.2 support attaching the debugger to an external managed dll?

Having all your C# game scripts in a single DLL for a specific game project makes it hard to share code between projects. It is possible to place code in external DLLs and access these from your scripts, but you immediately lose the ability to debug these classes. Using monodevelop to attach to the unity process only works when you debug your game dll. Why does this not work for external DLLs? Is there a workaround?

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 Zyxil · Feb 25, 2011 at 03:40 AM 0
Share

I haven't been able to get this to work. :sad: Been searching and trying for awhile. Script debugging works fine, just no external .dll's. (yet)

avatar image yoyo · Feb 25, 2011 at 04:58 PM 0
Share

Not ideal, but you could share scripts between projects using symbolic links, as described here -- http://answers.unity3d.com/questions/42513/global-and-not-project-related-editor-window

2 Replies

· Add your reply
  • Sort: 
avatar image
3
Best Answer

Answer by Johan 2 · Mar 11, 2011 at 01:23 AM

Unfortunately Visual Studio does not support debugging Unity projects for the moment. However, since Unity 3.2 one can attach to the running Unity process from MonoDevelop. This does not have to be from your Unity solution, but from any external dll project that is being used in your solution.

The trick is to create an mdb file for the external assembly and place it in the same folder as the dll that you import into your assembly.

"C:\Program Files (x86)\Unity\Editor\Data\Mono\lib\mono\2.0\pdb2mdb.exe" extlib.dll

1.)Set the output path of the mono external dll project to be somewhere in your asset folder. As a post build step, you can run pdb2mdb.exe to create the mdb file in the same folder.

2.)Attach to the Unity process.

3.)Set a breakpoint anywhere you like

4.) Now exercise the code by running your scene in the Unity Editor.

It should break in the external dll.

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 mgoi.tbgames · Jan 26, 2012 at 03:33 PM

Some additional info:

For those having problems generating mdb's of the dll's: - The DLL may not use "yield return" otherwise pdb2mdb will give an error or even crash. - .NET Framwork 4.0 is not supported. (3.5. works)

Tested it with unity 3.4.

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 yoyo · Dec 07, 2012 at 11:23 PM 0
Share

You should use $$anonymous$$onoBleedingEdge\lib\mono\4.0\pdb2mdb.exe and now couroutines / yield return will work fine. (Tested in Unity 3.5.6)

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

2 People are following this question.

avatar image avatar image

Related Questions

How do I include added dll's to a android apk build? 1 Answer

External DLL + Unityscript = Not Implemented 1 Answer

How to work with Steam API? 1 Answer

Can I use a DLL in a iOS game? 1 Answer

Can Editor scripts be in external DLL's or assemblies? 1 Answer


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