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 Ersin · Mar 13, 2014 at 02:25 PM · librarywindows store

Windows Metro Class Library

I want to call UnityPlayer.AppCallbacks.Instance.InvokeOnAppThread function from MyPlugin. But i can not add UnityPlayer.dll to reference of MyPlugin. After i am trying to build , visual studio return this error:

There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture, "x86", of the implementation file "C:\\\\Program Files (x86)\\Unity\\Editor\\Data\\PlaybackEngines\\metrosupport\\Players\\Windows80\\X86\\release\\UnityPlayer.dll" for "C:\\Program Files (x86)\\Unity\\Editor\\Data\\PlaybackEngines\\metrosupport\\Players\\Windows80\\X86\\release\\UnityPlayer.winmd". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and implementation file, or choose a winmd file with an implementation file that has a processor architecture which matches the targeted processor architecture of your project.

How can i add UnityPlayer.dll to my class library ? or How can i call unity thread from class library ?

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by miratrix · Mar 13, 2015 at 07:02 PM

Works only for unity 4.6.* If you build anything for wp8,and open .csproj file with any xml editor, you will see that unity adds different versions of UnityPlayer.dll(arm and x86) based on what you select

 <When Condition=" '$(Configuration)' == 'Debug' Or '$(Configuration)' == 'Release' ">
   <ItemGroup>
     <Reference Include="BridgeInterface">
       <HintPath>..\Players\$(Platform)\Release\BridgeInterface.winmd</HintPath>
     </Reference>
     <Reference Include="UnityPlayer">
       <HintPath>..\Players\$(Platform)\Release\UnityPlayer.winmd</HintPath>
     </Reference>
     <Reference Include="WinRTBridge">
       <HintPath>..\Players\$(Platform)\Release\WinRTBridge.dll</HintPath>
     </Reference>
   </ItemGroup>
 </When>
 <Otherwise>
   <ItemGroup>
     <Reference Include="BridgeInterface">
       <HintPath>..\Players\$(Platform)\$(Configuration)\BridgeInterface.winmd</HintPath>
     </Reference>
     <Reference Include="UnityPlayer">
       <HintPath>..\Players\$(Platform)\$(Configuration)\UnityPlayer.winmd</HintPath>
     </Reference>
     <Reference Include="WinRTBridge">
       <HintPath>..\Players\$(Platform)\$(Configuration)\WinRTBridge.dll</HintPath>
     </Reference>
   </ItemGroup>
 </Otherwise>
  

This code is responsable for that. Just build any project for wp8 copy Players folder to the root of your dll solution location, add add this lines of code to you dll's csproj file.
You will also need this

 <Reference Include="UnityEngine">
   <HintPath>UnityEngine.dll</HintPath>
 </Reference>
 <Reference Include="UnityEngine.UI">
   <HintPath>UnityEngine.UI.dll</HintPath>
 </Reference>
 <Reference Include="WinRTLegacy">
   <HintPath>WinRTLegacy.dll</HintPath>
 </Reference>
  

And you have to copy this 3 dll to you project location, not solution. What i'm trying to say here-just build anything for wp8 and study how unity wires up the dll, and try to repeat. !!Not works in unity5

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

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

Related Questions

What does Symlink Unity Libraries do? 5 Answers

Using a flash swc library when building for flash in 4.0 1 Answer

iOS MediaPlayer get songs in Audio like Android 0 Answers

help for static library 0 Answers

Visual Studio - Missing "GameAssembly.lib" 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