11 Replies Latest reply on Mar 20, 2017 1:13 AM by MartyG

    About MSIL to x86

    KY_JIAO

      I reference the Intel.RealSense.Unity and Intel.RealSense.Scan.Unity in My Unity project.  and , when I build my project in VS 2015,i got following warning:

       

      warning MSB3270: There was a mismatch between the processor architecture of the project being build "MSIL" and the processor architecture of the reference "Intel.RealSense.Unity", "x86".

      warning MSB3270: There was a mismatch between the processor architecture of the project being build "MSIL" and the processor architecture of the reference "Intel.RealSense.Scan.Unity", "x86".

       

      捕获.PNG

       

      how can i fix?

        • 1. Re: About MSIL to x86
          MartyG

          Unity 5 is 64 bit (x64).  This is why 64-bit RealSense library files (DLL) need to be used with Unity in order for the camera to work.  You should also set your project's build to use x64 architecture instead of x86, otherwise you can get the message that you showed.  You can do this with the 'build architecture' drop-down menu on the Build Settings window.  You can find this window in Unity 5 with File > Build Settings.

          • 2. Re: About MSIL to x86
            KY_JIAO

            but intel dose not provide x64 intel.realsense.unity.dll i only found x86 dll

            • 3. Re: About MSIL to x86
              MartyG

              What I meant was that there does not seem to be separate x86 and x64 versions of Intel.RealSense.Unity.dll, just the one file that you found.  For this file, x86 or x64 does not seem to matter.

               

              When you look at the error message that you posted, 'Intel.RealSense.Unity' and 'x86' are in separate quotation marks - they are not part of the same file name.  This suggests to me that your problem is probably that you have 'x86' set in the Architecture menu in the Build Settings window, and you should change that menu to say 'x64'

              • 4. Re: About MSIL to x86
                KY_JIAO

                My program is running normal debugging in unity, but when I release the unity program, when running to SenseManager.Init() the program will automatically collapse!

                • 5. Re: About MSIL to x86
                  MartyG

                  do you mean that your program runs okay in the editor mode but when you do a full Build and Run test, the program crashes?  This is another symptom of the Architecture menu in Unity being set to x86.  For some strange reason, Unity sets it by default to x86 even though Unity 5 is 64-bit software.  I suppose it is to provide backward compatibility with programs made in Unity 4.

                   

                  I please need to know what your Unity 'Architecture' menu is set to.  So please follow these steps.

                   

                  1.  In Unity, please go to the File menu and select the 'Build Settings' option.

                   

                   

                  2.  On the build Settings window, open the 'Architecture' menu.  If it says 'x86', please change it to 'x86_64'.

                   

                   

                  3.  Run your program and see if your problem has been fixed.

                  • 6. Re: About MSIL to x86
                    KY_JIAO

                    Yes as you said

                    Below is my screenshots in debug mode, it's normal

                    捕获.PNG

                    Below is I after the release of the screenshot

                    捕获.PNG

                    捕获.PNG

                    when i run App.exe that was i buid, the program crashed!

                    • 7. Re: About MSIL to x86
                      MartyG

                      It looks as though the Sense Manager component is crashing when the program is run in full Build And Run mode, which then makes your program crash.

                      • 8. Re: About MSIL to x86
                        KY_JIAO

                        Yes,Do you know how to debug?

                        Below is my source code

                        捕获.PNG

                        捕获.PNG

                        捕获.PNG

                        • 9. Re: About MSIL to x86
                          MartyG

                          My experience is that whenever somebody tries to write their own code to initialize the Sense Manager, the program often crashes.  It is not an easy script to write!

                           

                          I do not know enough about Sense Manager programming to debug it, as I have always used the Unity Toolkit that comes packaged with the RealSense SDK.  This creates a Sense Manager in your project for you when a RealSense script is run, so that you do not have to write your own Sense Manager creation script.

                          • 10. Re: About MSIL to x86
                            KY_JIAO

                            Before I found the problem, I was made of in a background thread initialization, I now remove the initialization to the main thread, the issue is resolved.

                            1 of 1 people found this helpful
                            • 11. Re: About MSIL to x86
                              MartyG

                              It's great news that you found a solution!  Good luck with your project, and please return to the forum any time that you have a problem. 

                              1 of 1 people found this helpful