Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

External plugins conflict

Discussion in 'Windows' started by Chiri, Oct 28, 2014.

  1. Chiri

    Chiri

    Joined:
    Mar 11, 2013
    Posts:
    6
    Hi all,

    I was trying to make a small plugin for WP8.1 and conect it to unity, but i get a Reflection Exception when i add the file to the Asset/Plugins folder:

    The plugin is nothing more than a dll that contains the following
    Code (CSharp):
    1. using System;
    2. using System.Collections;
    3.  
    4. namespace LocalStorager
    5. {
    6.     public class LocalSave
    7.     {
    8.         public static void Save()
    9.         {
    10. #if UNITY_EDITOR
    11. #endif
    12.         }
    13.     }
    14. }
    After much breaking my head i moved started trying to add the plugins in an empty project to see why it was giving my this problem. Fially the exception stoped when i removed the Facebook plugins Editor folder
    (Assets/Facebook/Editor)

    This is very odd since i cant seem to figure out why that folder would conflic in a way that would raise a Reflection Exception.

    I am very confused and have no idea how to fix this issue. Any help is greatly apreaciated...

    Update #1

    After doing some more diggin i found out that Unity does have logs when creating the assemblies. In it there was the compile error but i cant seem to understand the error.

    Any ideas?

    Update #2

    Found out there is the same error for the Temp/Assembly-CSharp.

    I wonder if its because of visual studio 2013 and the .Net framework version... Unty is supposed to be .2 but .net 2013 is 4.5 ?
     
    Last edited: Oct 29, 2014
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,658
    Even when using VS 2013, you can specify different .NET framework in the project properties, for plugin which is only be used in the Editor, you'll have to specify .NET 3.5
     
  3. Chiri

    Chiri

    Joined:
    Mar 11, 2013
    Posts:
    6
    I can't seem to be able to do that. I have Windows 8.1 and have enabled the .Net 3.5 in the control panel but i am unable to select it as a target platform.
     
  4. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,658
    Try reading this document for more clarity - http://docs.unity3d.com/Manual/wp8-plugins-guide-csharp.html ,while it's for Windows Phone 8, for Windows Store Apps it's almost identical, the only difference will be when creating plugin for Windows Store Apps, choose Windows Store instead of Windows Phone 8.

    P.S You don't need to do anything in the Control Panel
     
  5. Chiri

    Chiri

    Joined:
    Mar 11, 2013
    Posts:
    6
    Thanks Tomas. That tutorial helped me see why i couldnt get the plugin to work.

    As for future reference, I had to install visual studio 2010 express in order to compile the "fake .dll" with the 3.5 framework. And the phone plugin with Visual studio 2013 express.

    * The control panel thing was related about not having the Framework active in windows 8. Some sites said to check that is was enabled.
     
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,491
    I remember Visual Studio 2012 asking me to install .NET 3.5 when trying to create such project - I don't think you had to install 2010.
     
  7. Chiri

    Chiri

    Joined:
    Mar 11, 2013
    Posts:
    6
    Well, for some reason it didn't, so that was an act of desperation