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 Vincent 2 · Apr 21, 2011 at 05:38 PM · dllstack

Can't retrieve stack information from a dll

I like to print stack info (file name, line in file) along with messages when logging debug messages :

... StackTrace stacktrace = new StackTrace(true); StackFrame stackframe = stacktrace.GetFrame(0);

string currentFile = stackframe.GetFileName(); int currentLine = stackframe.GetFileLineNumber();

Debug.Log("My debug msg" + "in " currentFile + " @"+currentLine); ...

However, I can't retrieve such info from a dll used in a Unity project (line is always 0 and no file name is retrieved). This only works with scripts that are directly included in the project.

This issue makes it very hard to debug my application... Any ideas?

Comment
Add comment · Show 3
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 superpig ♦♦ · Apr 22, 2011 at 01:33 AM 0
Share

Doesn't Debug.Log do this for you automatically?

avatar image Vincent 2 · Apr 22, 2011 at 08:17 AM 0
Share

From what I understand, Debug.Log does tell you what object/method the message originates from.

The thing is, to keep things manageable, I use an external logging application (Sentinel) which listens to UDP messages sent from my DLLs. That way, I can easily filter/highlight messages I'm interested in.

However, stack information can't be retrieved when such a DLL is used in the context of a Unity application :( It works perfectly when I use my DLLs from a C# executable though...

avatar image superpig ♦♦ · Apr 22, 2011 at 09:35 AM 0
Share

Oh, I see - you're not actually Debug.Log()ing the data, but handing it to a UDP emitter ins$$anonymous$$d?

Does it still work with plain C# applications that are built and run with $$anonymous$$ono, rather than $$anonymous$$icrosoft's CLR?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by BigBulle · Feb 06, 2012 at 05:01 PM

One extremely big Unity drawback IMO...

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

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

1 Person is following this question.

avatar image

Related Questions

Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers

reduce size of included dlls? 2 Answers

Why is UnityEngine.dll not signed? 0 Answers

How do you put stuff in assemblies? 1 Answer

Editor Scripts in Dll 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