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 invicticide · Dec 12, 2013 at 07:20 AM · webplayerdebuggingsecuritysandbox

How do I identify the offending method for "attempt to access a private/protected method failed"?

I know that this exception is thrown because I'm calling some method that's prohibited by the webplayer security sandbox. My problem is, the callstack in the exception only tells me in which function the offending call resides (in this case, that's MonoBehaviour.Awake), but not what the offending call actually is. This particular function does rather a lot of stuff, and there's a whole smorgasboard of calls that may or may not be the one in question.

Is there any way to get more information about which particular call is failing? Or do i just need to start binary-searching my way through the function, commenting out chunks and rebuilding the web player eleven million times? :(

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 Jamora · Dec 12, 2013 at 08:04 AM 0
Share

Does Attempt to access a method failed help?

avatar image invicticide · Dec 12, 2013 at 08:18 AM 0
Share

No. That question does deal with the same error, but it doesn't deal with identifying the specific function call which is throwing the error.

2 Replies

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

Answer by invicticide · Dec 12, 2013 at 08:54 AM

I ended up just commenting out most of the function and slowly adding bits back in, rebuilding the web player each time, until the exception occurred. Kind of a silly workflow, but I was able to identify the offending function -- Assembly.GetName(), of all things -- and work around the issue such that the web player build works properly.

It would be really nice if that exception actually listed the method call that threw the exception, rather than just the name of the containing function. Really nice indeed. :|

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 Bunny83 · Dec 12, 2013 at 08:47 AM

Well that just tells me that your function just contains too much code. Simply break it up into multiple meaningful sub methods. That way you get a proper stack trace. Without seeing you code it's impossible to say what you do wrong here.

Do you use any plugins / DLLs?

Comment
Add comment · Show 3 · 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 invicticide · Dec 12, 2013 at 08:52 AM 0
Share

No, see, the problem is that the exception is thrown by a method call, but that method call is not listed in the exception. To put it another way: I'm effectively getting a stack trace where the topmost entry of the stack has been omitted, so the only way to figure out what the topmost entry should've been is by process of eli$$anonymous$$ation.

We're not talking about thousands of lines of code, here. I'm not a total noob. :P I just didn't want to have to binary-search and rebuild the webplayer several times to figure out which specific call was the problem, when (to my $$anonymous$$d) the exception should've just listed that in the first place.

But in any case, I did find it, and will be posting the "answer" (such as it is) presently.

avatar image Bunny83 · Dec 12, 2013 at 09:18 AM 0
Share

$$anonymous$$y point still stands. If you have small portions of code it shouldn't be that hard to figure out which line is causing the problem. Also when using reflection in the web player you should check compatibility first or at least the moment you get an error like that.

What kind of answers have you expected? That we should guess you use reflection and suggest to check it? You only provided us some symptoms but, like a doctor, we can't say what's wrong without a closer look ;)

avatar image invicticide · Dec 12, 2013 at 09:21 AM 0
Share

I was kinda hoping there was a log file or a debug setting or something that I wasn't previously aware of. Clearly not.

That compatibility link is useful, though. Thanks for that.

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

18 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 avatar image avatar image avatar image avatar image

Related Questions

TCPClient on webplayer crashes. 1 Answer

Webplayer sandbox security policy: When do I prefetch security policy? 1 Answer

is there a way to secure the .unity3d web player file from downloading? 1 Answer

Webplayer ActiveX 3 Answers

How do I protect my webplayer from beeing used from other sites? 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