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
1
Question by Hotshot10101 · Dec 10, 2012 at 04:03 PM · errorunity 4compilerinternal

Internal Compiler Error #3 (ILGenerator Emit Issue)

I am getting an Internal Compiler Error. The research I have done so far on this one points to the only solution being to upgrade the Mono system to a newer version. Since this is Unity 4.0 I don't know how I can possibly do that and even if Unity will upgrade any time soon. What do I do about that?

Here is the error:

 Internal compiler error. See the console log for more information. output was:
 Unhandled Exception: System.ArgumentException: Trying to emit a local from a different ILGenerator.
   at System.Reflection.Emit.ILGenerator.Emit (OpCode opcode, System.Reflection.Emit.LocalBuilder local) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.LocalTemporary.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.MemberExpr.EmitInstance (Mono.CSharp.EmitContext ec, Boolean prepare_for_load) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.FieldExpr.Emit (Mono.CSharp.EmitContext ec, Boolean leave_copy) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.HoistedVariable.Emit (Mono.CSharp.EmitContext ec, Boolean leave_copy) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.VariableReference.Emit (Mono.CSharp.EmitContext ec, Boolean leave_copy) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.VariableReference.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.Argument.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.Arguments.Emit (Mono.CSharp.EmitContext ec, Boolean dup_args, Mono.CSharp.LocalTemporary this_arg) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.Invocation.EmitCall (Mono.CSharp.EmitContext ec, Boolean is_base, Mono.CSharp.Expression instance_expr, System.Reflection.MethodBase method, Mono.CSharp.Arguments Arguments, Location loc, Boolean dup_args, Boolean omit_args) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.Invocation.EmitCall (Mono.CSharp.EmitContext ec, Boolean is_base, Mono.CSharp.Expression instance_expr, System.Reflection.MethodBase method, Mono.CSharp.Arguments Arguments, Location loc) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.MethodGroupExpr.EmitCall (Mono.CSharp.EmitContext ec, Mono.CSharp.Arguments arguments) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.Invocation.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.Invocation.EmitStatement (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.StatementExpression.DoEmit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.Statement.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.Block.DoEmit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.Block.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.ExplicitBlock.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.ToplevelBlock.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.MethodData.Emit (Mono.CSharp.DeclSpace parent) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.AbstractPropertyEventMethod.Emit (Mono.CSharp.DeclSpace parent) [0x00000] in <filename unknown>:0 
   at Mono.CSharp.Event.Emit () [0x00000] in <filename unknown>:0 
   at Mono.CSharp.TypeContainer.EmitType () [0x00000] in <filename unknown>:0 
   at Mono.CSharp.RootContext.EmitCode () [0x00000] in <filename unknown>:0 
   at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0 
   at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0 
 
Comment
Add comment · Show 6
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 Dave-Carlile · Dec 10, 2012 at 05:42 PM 0
Share

Unless the "console log" is already telling you, I would suggest trying to isolate what part of your code is causing the error by gradually removing stuff. Once you locate the code, try changing the algorithm, moving things around, into functions, etc. Ugly to be sure, but there's a reason we have the word "workaround". And, report it as a bug.

avatar image Hotshot10101 · Dec 10, 2012 at 06:03 PM 0
Share

Thank you for the reply and suggestion.

Sadly this is not working well because the code is so very intertwined I can't seem to remove stuff without causing other errors that then hide this error.

avatar image winxalex · Jul 01, 2015 at 12:44 PM 0
Share

@Dave In 21st century removing stuff to find out what causing error is neanderthal philosophy. This unavoidable stellar tactic is also often used with Unity GUI. Shame!.

avatar image Dave-Carlile · Jul 01, 2015 at 01:54 PM 0
Share

Well then @winxalex, you can move on to using your 100% perfect, bug free 21st century tools while the rest of us live in reality.

avatar image winxalex · Jul 01, 2015 at 03:14 PM 0
Share

@Dave Carllie F that reality where top IDE are nothing more then fancy intelli texteditors and tools that shows 100s useless error lines so you need to remove lines one by one to find out what is wrong. 1000 of useless waiting hrs for editor compiler code, then player compiler code to find out that you have done supid error and in order to fix it, u need to recompile everything. It up to you to fight for Live coding or to keep using Punched cards.

Show more comments

3 Replies

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

Answer by Hotshot10101 · Apr 17, 2013 at 01:41 PM

From everything I can tell these Internal Compiler errors happen when I try to include a .dll file that requires .NET functionality that is higher than 2.0 and part of the bleeding edge stuff included in Unity's mono. That is probably why it is called bleeding edge, eh?

Anyway, the answer is just trial and error. Some newer .NET stuff works and some just doesn't even though it is included and supposedly "in there".

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 winxalex · Jul 01, 2015 at 01:10 PM

 //this.channels.ForEach (chn => chn.nodes.ForEach (nd => nd.onStart.AddListener(value)));<-- this cause same error.

//solution

   foreach(SequenceChannel channel in this.channels)
                              foreach(SequenceNode node in channel.nodes)
                                     node.onStart.AddListener(value);
                         }

It is obvious that many stuff in Mono towards .NET are underdeveloped.

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 Kurius · Nov 30, 2016 at 10:50 PM

I had what seemed to be several warnings appearing as errors! When I scrolled down through the warnings, I noticed there truly was an error listed at the very end.

ERROR... "Unhandled Exception: System.ArgumentException: Trying to emit a local from a different ILGenerator"

CAUSE... The error occurred because I had just put a TRY CATCH statement inside a COROUTINE. Unity doesn't like that!

SOLUTION... I resolved the error be removing all Try Catch statements from all Coroutines.

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

12 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

Related Questions

error CS0016 - Access to the path is denied 1 Answer

Internal Compiler Error 1 Answer

Another Internal Compiler Error 2 Answers

Warning messages are turning into Internal Compiler Errors...? 6 Answers

Internal Compiler Error again 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