Search Unity

Use a third party plugins

Discussion in 'Windows' started by TobyKaos, May 4, 2016.

  1. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    214
    Hello,

    I have managed to test a simple app (one sprite that move). Now I want to add a third party plugin (clanofthecloud) that provide a unity package with a .dll.
    I do not managed to compil my test with this 3rd party lib on VS2015.

    This 3Rd party lib use Threading, Exception ... in their C# code.

    I have tried to set Dont process on dll, tried to uset .net core partially but without succes. I managed to generate the VS project but anytime I build in VS I have error:
    (WinRTBrige missing, or System.ApplicationException missing, ....) Depends on config I used.

    Even tried with il2cpp but Unity (5.3.4f1) throw error at build.

    Any help?

    Must I remove this 3Rd party lib? Or modify it (Open Source)?
    Maybe use the C++ version of this lib but I do not know how to add it later on VS.

    Thank you for your help. I am making a game for a game studio as indie and deadline approch (Android, ios and WebGL version are ok, but I must create windows phone app)
     
  2. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    214
    I think the bvest settings are:

    . Plugins dll dont process
    . Universal 10 + XAML + C# Project
    . Script Backend .NET
    . Use Net Core Partially

    In this case unity create 3 projects and the first two compil well but the main project of the solution do not want.

    The error is:
    Cannot find type System.ApplicationException in module CommonLanguageRuntime

    Then I suppose I must modify code of 3Rd party lib because this is not supported?

    Where to see what is supported?
     
  3. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,911
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,678
    Could you paste that error?
     
  5. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    214
    For il2cpp I have this error:

    ebServices.xml" -x "C:\Program Files\Unity\Editor\Data\PlaybackEngines\MetroSupport\Whitelists\Core.xml" -x "C:\Program Files\Unity\Editor\Data\PlaybackEngines\MetroSupport\Whitelists\IMGUI.xml" -x "C:\Program Files\Unity\Editor\Data\PlaybackEngines\MetroSupport\Whitelists\JSONSerialize.xml" -x "C:\Program Files\Unity\Editor\Data\PlaybackEngines\MetroSupport\Whitelists\ParticlesLegacy.xml" -x "C:\Program Files\Unity\Editor\Data\PlaybackEngines\MetroSupport\Whitelists\ParticleSystem.xml" -x "C:\Program Files\Unity\Editor\Data\PlaybackEngines\MetroSupport\Whitelists\Physics.xml" -x "C:\Program Files\Unity\Editor\Data\PlaybackEngines\MetroSupport\Whitelists\Physics2D.xml" -x "C:\Program Files\Unity\Editor\Data\PlaybackEngines\MetroSupport\Whitelists\Terrain.xml" -x "C:\Program Files\Unity\Editor\Data\PlaybackEngines\MetroSupport\Whitelists\TerrainPhysics.xml" -x "C:\Program Files\Unity\Editor\Data\PlaybackEngines\MetroSupport\Whitelists\TextRendering.xml" -x "C:\Program Files\Unity\Editor\Data\PlaybackEngines\MetroSupport\Whitelists\UI.xml" -x "C:\Program Files\Unity\Editor\Data\PlaybackEngines\MetroSupport\Whitelists\UNET.xml" -x "C:\Program Files\Unity\Editor\Data\PlaybackEngines\MetroSupport\Whitelists\UnityAds.xml" -x "C:\Program Files\Unity\Editor\Data\PlaybackEngines\MetroSupport\Whitelists\UnityAnalytics.xml" -x "C:\Program Files\Unity\Editor\Data\PlaybackEngines\MetroSupport\Whitelists\UnityConnect.xml" -x "C:\Program Files\Unity\Editor\Data\PlaybackEngines\MetroSupport\Whitelists\UnityWebRequest.xml" -x "C:\Program Files\Unity\Editor\Data\PlaybackEngines\MetroSupport\Whitelists\VR.xml" -x "C:\Program Files\Unity\Editor\Data\PlaybackEngines\MetroSupport\Whitelists\Web.xml" -d "D:\ChaosGames\Prestation\Dowino\Klesia\test\TestClan\Temp\StagingArea\Data\Managed" -a "D:\ChaosGames\Prestation\Dowino\Klesia\test\TestClan\Temp\StagingArea\Data\Managed\Assembly-CSharp.dll" -a "D:\ChaosGames\Prestation\Dowino\Klesia\test\TestClan\Temp\StagingArea\Data\Managed\UnityEngine.UI.dll" -a "D:\ChaosGames\Prestation\Dowino\Klesia\test\TestClan\Temp\StagingArea\Data\Managed\CotcSdk.dll"

    stdout:
    Fatal error in Mono CIL Linker
    System.Exception: Error processing method: 'System.Void CotcSdk.UnityHttpClientV2/UnityRequest::AbortRequest()' in assembly: 'CotcSdk.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void UnityEngine.Experimental.Networking.UnityWebRequest::Abort()
    � Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference)
    � Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction)
    � Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
    � Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
    � Mono.Linker.Steps.MarkStep.ProcessQueue()
    --- Fin de la trace de la pile d'exception interne ---
    � Mono.Linker.Steps.MarkStep.ProcessQueue()
    � Mono.Linker.Steps.MarkStep.Process()
    � Mono.Linker.Pipeline.Process(LinkContext context)
    � Mono.Linker.Driver.RunDriver(Driver driver)
    stderr:

    UnityEngine.Debug:LogError(Object)
    UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:94)
    UnityEditorInternal.AssemblyStripper:RunAssemblyLinker(IEnumerable`1, String&, String&, String, String) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:107)
    UnityEditorInternal.AssemblyStripper:StripAssembliesTo(String[], String[], String, String, String&, String&, String, IIl2CppPlatformProvider, IEnumerable`1, Boolean) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:100)
    UnityEditorInternal.AssemblyStripper:RunAssemblyStripper(String, IEnumerable, String, String[], String[], String, IIl2CppPlatformProvider, RuntimeClassRegistry, Boolean) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:204)
    UnityEditorInternal.AssemblyStripper:StripAssemblies(String, IIl2CppPlatformProvider, RuntimeClassRegistry, Boolean) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:131)
    UnityEditorInternal.IL2CPPBuilder:Run() (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:201)
    UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry, Boolean) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:128)
    PostProcessUAPIl2Cpp:RunIL2CPP() (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessUAPIl2Cpp.cs:92)
    PostProcessWinRT:process() (at C:/buildslave/unity/build/PlatformDependent/WinRT/SharedSources/CSharp/PostProcessWinRT.cs:131)
    UnityEditor.HostView:OnGUI



    Semmes to be a problem with an experimental http request used by the 3rd party lib.
     
  6. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    214
    If possible I will stay with mono script backend but how to deal with the namespace System.ApplicationException?
     
  7. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,678
    If you have the source code for the DLL that uses System.ApplicationException, you can just replace it with normal "System.Exception". That would probably be the easiest solution.

    Is that the only thing that's used that is not available? When building from Unity, it should print all the unavailable APIs that were used in the console.
     
  8. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    214
    When I use settings above unity does not warn about nothing. I must check if vs halt on error.
    At this time only this error on vs. I will try but today is off in france
     
  9. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    214
    If I use .NET and do not check dont process .dll of the lib then Unity show me errors on console:


    Reference rewriter: Error: type `System.Collections.Specialized.IOrderedDictionary` doesn't exist in target framework.
    Reference rewriter: Error: method `System.Collections.IDictionaryEnumerator System.Collections.Specialized.IOrderedDictionary::GetEnumerator()` doesn't exist in target framework

    System.Threading.ThreadStart
    System.Void System.Threading.ThreadStart::.ctor(System.Object,System.IntPtr)
    System.Void UnityEngine.Experimental.Networking.UnityWebRequest::.ctor(System.String)
    System.Collections.Generic.Dictionary
    System.Void System.Net.HttpWebRequest::set_UserAgent(System.String)
    System.IAsyncResult System.IO.Stream::BeginRead(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)

    ...

    IOrderedDictionnary is used in LitJSON and is .NEt for UWP apps as System.Threading.

    Then I think I must check dont process .dll for the 3rd party plugins.

    I will Git Clone their plugin and replace System.ApplicationException by System.Exception.
     
  10. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,735
    No, that's not the right thing to do. You will simply hide the errors, that will only hunt you down later (at runtime or, even worse, when you will fail the certification when submitting to store).
     
  11. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    214
  12. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,735
    It is available in desktop version of .NET Framework. Windows Store Apps uses .NET Core, many legacy APIs are not there.
     
  13. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    214
  14. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    214
    If I setup
    . Plugins dll dont process
    . Universal 10 + XAML + C# Project
    . Script Backend .NET
    . Use Net Core Partially

    Then in execution the script that depends on 3rd party lib is missing.
     
  15. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,735
    You can easily figure out such things. Just create a C# application for Windows 10 Universal and try using those types/methods.
     
  16. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    214
    Great idea. I will try

    Else the log console error when I build in Unity without check dont process:

    Reference Rewriter found some errors while running with command --target="Temp\StagingArea\CotcSdk.dll" --additionalreferences="Temp\StagingArea","C:\Program Files (x86)\Windows Kits\10\UnionMetadata\Facade","C:\Program Files (x86)\Windows Kits\10\References\Windows.ApplicationModel.Calls.CallsVoipContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Devices.Printers.PrintersContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Foundation.FoundationContract\2.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Foundation.UniversalApiContract\2.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Graphics.Printing3D.Printing3DContract\2.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Networking.Connectivity.WwanContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.ApplicationModel.Activation.ActivatedEventsContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.ApplicationModel.Activation.ActivationCameraSettingsContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.ApplicationModel.Activation.ContactActivatedEventsContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.ApplicationModel.Activation.WebUISearchActivatedEventsContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.ApplicationModel.Background.BackgroundAlarmApplicationContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.ApplicationModel.Calls.Background.CallsBackgroundContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.ApplicationModel.Calls.LockScreenCallContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.ApplicationModel.Resources.Management.ResourceIndexerContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.ApplicationModel.Search.Core.SearchCoreContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.ApplicationModel.Search.SearchContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.ApplicationModel.Wallet.WalletContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Devices.Custom.CustomDeviceContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Devices.Portable.PortableDeviceContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Devices.Printers.Extensions.ExtensionsContract\2.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Devices.Scanners.ScannerDeviceContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Devices.Sms.LegacySmsApiContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Gaming.Preview.GamesEnumerationContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Globalization.GlobalizationJapanesePhoneticAnalyzerContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Management.Deployment.Preview.DeploymentPreviewContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Management.Orchestration.OrchestrationContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Management.Workplace.WorkplaceSettingsContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Media.Capture.AppCaptureContract\2.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Media.Capture.CameraCaptureUIContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Media.Devices.CallControlContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Media.MediaControlContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Media.Playlists.PlaylistsContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Media.Protection.ProtectionRenewalContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Networking.NetworkOperators.LegacyNetworkOperatorsContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Networking.Sockets.ControlChannelTriggerContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Security.EnterpriseData.EnterpriseDataContract\2.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Security.ExchangeActiveSyncProvisioning.EasContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Services.Maps.GuidanceContract\2.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Services.Maps.LocalSearchContract\2.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.System.Profile.SystemManufacturers.SystemManufacturersContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.System.Profile.ProfileHardwareTokenContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.System.Profile.ProfileRetailInfoContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.System.UserProfile.UserProfileContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.System.UserProfile.UserProfileLockScreenContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.UI.ApplicationSettings.ApplicationsSettingsContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.UI.Core.AnimationMetrics.AnimationMetricsContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.UI.Core.CoreWindowDialogsContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.UI.Xaml.Hosting.HostingContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Web.Http.Diagnostics.HttpDiagnosticsContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Devices.DevicesLowLevelContract\2.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.System.SystemManagementContract\2.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.ApplicationModel.Calls.CallsPhoneContract\2.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.ApplicationModel.SocialInfo.SocialInfoContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.ApplicationModel.CommunicationBlocking.CommunicationBlockingContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Devices.SmartCards.SmartCardBackgroundTriggerContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Devices.SmartCards.SmartCardEmulatorContract\2.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Embedded.DeviceLockdown.DeviceLockdownContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Networking.NetworkOperators.NetworkOperatorsFdnContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Phone.PhoneContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Phone.StartScreen.DualSimTileContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.UI.WebUI.Core.WebUICommandBarContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.System.Profile.ProfileSharedModeContract\1.0.0.0" --platform="C:\Program Files (x86)\Windows Kits\10\UnionMetadata\Facade\Windows.winmd" --support="Temp\StagingArea\WinRTLegacy.dll" --supportpartialns=Unity.Partial --system=System --dbg=pdb --lock=UWP\project.lock.json --alt=System.Xml.Serialization;System.Collections,System.Collections.NonGeneric;System.Reflection,System.Reflection.TypeExtensions;System.IO,System.IO.FileSystem;System.Net,System.Net.Primitives;System.Net.Sockets,System.Net.Primitives;System.Xml,System.Xml.XmlDocument --ignore=System.IConvertible,mscorlib.
    Error: type `System.Collections.Specialized.IOrderedDictionary` doesn't exist in target framework. It is referenced from CotcSdk.dll at LitJson.IJsonWrapper.
    Error: type `System.Collections.Specialized.IOrderedDictionary` doesn't exist in target framework. It is referenced from CotcSdk.dll at LitJson.JsonData.
    Error: type `System.Collections.Specialized.IOrderedDictionary` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Object LitJson.JsonData::System.Collections.Specialized.IOrderedDictionary.get_Item(System.Int32).
    Error: method `System.Object System.Collections.Specialized.IOrderedDictionary::get_Item(System.Int32)` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Object LitJson.JsonData::System.Collections.Specialized.IOrderedDictionary.get_Item(System.Int32).
    Error: type `System.Collections.Specialized.IOrderedDictionary` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Void LitJson.JsonData::System.Collections.Specialized.IOrderedDictionary.set_Item(System.Int32,System.Object).
    Error: method `System.Void System.Collections.Specialized.IOrderedDictionary::set_Item(System.Int32,System.Object)` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Void LitJson.JsonData::System.Collections.Specialized.IOrderedDictionary.set_Item(System.Int32,System.Object).
    Error: type `System.Collections.Specialized.IOrderedDictionary` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Collections.IDictionaryEnumerator LitJson.JsonData::System.Collections.IDictionary.GetEnumerator().
    Error: method `System.Collections.IDictionaryEnumerator System.Collections.Specialized.IOrderedDictionary::GetEnumerator()` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Collections.IDictionaryEnumerator LitJson.JsonData::System.Collections.IDictionary.GetEnumerator().
    Error: type `System.Collections.Specialized.IOrderedDictionary` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Collections.IDictionaryEnumerator LitJson.JsonData::System.Collections.Specialized.IOrderedDictionary.GetEnumerator().
    Error: method `System.Collections.IDictionaryEnumerator System.Collections.Specialized.IOrderedDictionary::GetEnumerator()` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Collections.IDictionaryEnumerator LitJson.JsonData::System.Collections.Specialized.IOrderedDictionary.GetEnumerator().
    Error: type `System.Collections.Specialized.IOrderedDictionary` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Void LitJson.JsonData::System.Collections.Specialized.IOrderedDictionary.Insert(System.Int32,System.Object,System.Object).
    Error: method `System.Void System.Collections.Specialized.IOrderedDictionary::Insert(System.Int32,System.Object,System.Object)` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Void LitJson.JsonData::System.Collections.Specialized.IOrderedDictionary.Insert(System.Int32,System.Object,System.Object).
    Error: type `System.Collections.Specialized.IOrderedDictionary` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Void LitJson.JsonData::System.Collections.Specialized.IOrderedDictionary.RemoveAt(System.Int32).
    Error: method `System.Void System.Collections.Specialized.IOrderedDictionary::RemoveAt(System.Int32)` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Void LitJson.JsonData::System.Collections.Specialized.IOrderedDictionary.RemoveAt(System.Int32).
    Error: method `System.Type System.Type::GetInterface(System.String)` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Void LitJson.JsonMapper::AddArrayMetadata(System.Type).
    Error: method `System.Type System.Type::GetInterface(System.String)` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Void LitJson.JsonMapper::AddObjectMetadata(System.Type).
    Error: type `System.Threading.ThreadStart` doesn't exist in target framework. It is referenced from CotcSdk.dll at CotcSdk.DomainEventLoop CotcSdk.DomainEventLoop::Start().
    Error: method `System.Void System.Threading.ThreadStart::.ctor(System.Object,System.IntPtr)` doesn't exist in target framework. It is referenced from CotcSdk.dll at CotcSdk.DomainEventLoop CotcSdk.DomainEventLoop::Start().
    Error: type `System.Threading.ThreadStart` doesn't exist in target framework. It is referenced from CotcSdk.dll at CotcSdk.DomainEventLoop CotcSdk.DomainEventLoop::Start().
    Error: method `System.Void System.Threading.Thread::.ctor(System.Threading.ThreadStart)` doesn't exist in target framework. It is referenced from CotcSdk.dll at CotcSdk.DomainEventLoop CotcSdk.DomainEventLoop::Start().
    Error: method `System.Void System.Threading.Thread::Start()` doesn't exist in target framework. It is referenced from CotcSdk.dll at CotcSdk.DomainEventLoop CotcSdk.DomainEventLoop::Start().
    Error: method `System.Void System.Threading.Thread::Sleep(System.Int32)` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Void CotcSdk.DomainEventLoop::Run().
    Error: method `System.Text.Encoding System.Text.Encoding::get_Default()` doesn't exist in target framework. It is referenced from CotcSdk.dll at CotcSdk.HttpRequest CotcSdk.Gamer::MakeHttpRequest(System.String).
    Error: method `System.Void System.Threading.Thread::Sleep(System.Int32)` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Void CotcSdk.HttpClient::FinishWithRequest(CotcSdk.HttpClient/WebRequest,CotcSdk.HttpResponse).
    Error: type `System.Threading.WaitOrTimerCallback` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Void CotcSdk.HttpClient::processRequest(CotcSdk.HttpRequest,System.Object).
    Error: method `System.Void System.Threading.WaitOrTimerCallback::.ctor(System.Object,System.IntPtr)` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Void CotcSdk.HttpClient::processRequest(CotcSdk.HttpRequest,System.Object).
    Error: type `System.Threading.ThreadPool` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Void CotcSdk.HttpClient::processRequest(CotcSdk.HttpRequest,System.Object).
    Error: type `System.Threading.RegisteredWaitHandle` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Void CotcSdk.HttpClient::processRequest(CotcSdk.HttpRequest,System.Object).
    Error: type `System.Threading.WaitOrTimerCallback` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Void CotcSdk.HttpClient::processRequest(CotcSdk.HttpRequest,System.Object).
    Error: method `System.Threading.RegisteredWaitHandle System.Threading.ThreadPool::RegisterWaitForSingleObject(System.Threading.WaitHandle,System.Threading.WaitOrTimerCallback,System.Object,System.Int32,System.Boolean)` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Void CotcSdk.HttpClient::processRequest(CotcSdk.HttpRequest,System.Object).
    Error: method `System.Void UnityEngine.Experimental.Networking.UnityWebRequest::.ctor(System.String)` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Void CotcSdk.UnityHttpClientV2/UnityRequest::.ctor(CotcSdk.UnityHttpClientV2,System.String,CotcSdk.HttpRequest,System.Object,System.Int32).
    Error: method `System.Void UnityEngine.Experimental.Networking.UnityWebRequest::set_method(System.String)` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Void CotcSdk.UnityHttpClientV2/UnityRequest::.ctor(CotcSdk.UnityHttpClientV2,System.String,CotcSdk.HttpRequest,System.Object,System.Int32).
    Error: method `System.Void UnityEngine.Experimental.Networking.UnityWebRequest::SetRequestHeader(System.String,System.String)` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Void CotcSdk.UnityHttpClientV2/UnityRequest::.ctor(CotcSdk.UnityHttpClientV2,System.String,CotcSdk.HttpRequest,System.Object,System.Int32).
    Error: method `System.Void UnityEngine.Experimental.Networking.UploadHandlerRaw::.ctor(System.Byte[])` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Void CotcSdk.UnityHttpClientV2/UnityRequest::.ctor(CotcSdk.UnityHttpClientV2,System.String,CotcSdk.HttpRequest,System.Object,System.Int32).
    Error: method `System.Void UnityEngine.Experimental.Networking.UnityWebRequest::set_uploadHandler(UnityEngine.Experimental.Networking.Up<message truncated>
     
    Last edited: May 9, 2016
  17. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    214
    I have tried and implement IOrderedDictionary MSDN sample: https://msdn.microsoft.com/fr-fr/li....specialized.iordereddictionary(v=vs.90).aspx

    Added a gameobject with the script. Work well in Unity Editor but when I launch the UWP on my windows 10

    The referenced script on this Behaviour (Game Object 'GameObject') is missing!

    I do not understand why.

    EDIT: Ok just deleted the visual project and rebuild. Now it is ok and IOrderedDictionary is OK.

    Then the Plugins should works. I will try to recompil it
     
    Last edited: May 9, 2016
  18. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    214
    It is very hard to find why I cannot compil my project.

    When I build with unity 5.3.4f1 I have the errors in previsou post.

    The VS project is created and I can open it. But missing reference. I add its picking in Unprocessed folder.

    But now I have this error (and some other):

    The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=null'.

    Then we must have .net 4.0 ? But UWP use .NET 3.5 ? no?

    Thank you for your help.
     
  19. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    214
    I try again with dont process Plugin checked:

    . Unity No error
    . Visual Studio No Error

    But a runtime error:

    Initialize engine version: 5.3.4f1 (fdbb5133b820)

    'TestClan.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'D:\ChaosGames\Prestation\Dowino\Klesia\test\TestClan\Win10\TestClan\bin\x86\Release\AppX\UnityEngineProxy.dll'. Cannot find or open the PDB file.
    'TestClan.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'D:\ChaosGames\Prestation\Dowino\Klesia\test\TestClan\Win10\TestClan\bin\x86\Release\AppX\System.Linq.dll'. Cannot find or open the PDB file.
    Enabling independent input source.

    Logical Screen DPI is 96.00.

    The referenced script on this Behaviour is missing!

    (Filename: C:/buildslave/unity/build/Runtime/Mono/MonoBehaviour.cpp Line: 1498)


    'TestClan.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'D:\ChaosGames\Prestation\Dowino\Klesia\test\TestClan\Win10\TestClan\bin\x86\Release\AppX\System.Text.RegularExpressions.dll'. Cannot find or open the PDB file.
    'TestClan.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'D:\ChaosGames\Prestation\Dowino\Klesia\test\TestClan\Win10\TestClan\bin\x86\Release\AppX\System.Globalization.dll'. Module was built without symbols.
    The referenced script on this Behaviour (Game Object 'Clan of the Cloud SDK') is missing!

    (Filename: C:/buildslave/unity/build/Runtime/Mono/MonoBehaviour.cpp Line: 1655)


    UnloadTime: 46.503212 ms

    'TestClan.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'D:\ChaosGames\Prestation\Dowino\Klesia\test\TestClan\Win10\TestClan\bin\x86\Release\AppX\System.Reflection.Extensions.dll'. Module was built without symbols.
    Warning: unknown type CotcSdk.CotcGameObject detected. Using reflection to gather its type information. Consider to reference it from your scripts so it can gathered during the build process.

    (Filename: C:\buildslave\unity\build\Runtime/Scripting/Backend/DotNet/ScriptingTypeProvider_DotNet.cpp Line: 153)


    Exception thrown: 'System.IO.FileLoadException' in mscorlib.ni.dll
    FileLoadException: Could not load file or assembly 'System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
    at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
    at System.Reflection.RuntimeMethodInfo.get_ReturnType()
    at WinRTBridge.TypeInformationGatherer.GatherMethods(TypeInfo type, DotNetType* typeInfo)
    at WinRTBridge.TypeInformationGatherer.GatherTypeInfo(Int32 typeId, IntPtr typeInfoPtr)
    at UnityEngineProxy.InternalCalls.PInvokeCalls.Object_CUSTOM_FindObjectsOfType(Int32 param_0)
    at UnityEngineProxy.InternalCalls.Object_CUSTOM_FindObjectsOfType(Type type)
    at UnityEngine.Object.FindObjectOfType(Type type)
    at UnityEngine.Object.FindObjectOfType[T]()
    at SampleScene.Start()
    at SampleScene.$Invoke15(Int64 instance, Int64* args)
    at UnityEngine.Internal.$MethodUtility.InvokeMethod(Int64 instance, Int64* args, IntPtr method)
    (Filename: <Unknown> Line: 0)



    First seems missing a Script referenced in Plugins. But I have checked in visual studio (Go to definition) and visual open the assembly and show me the definition of CotcGameObject

    I use
    var cb = FindObjectOfType<CotcGameObject>();

    Second error is an exception.
     
  20. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    214
    If instead of search CotcGameObject at runtime I add a variable in another gameObject then visual complain at compil time:

    UnityInstallationDir "C:\Program Files\Unity\Editor".
    1> UnityWSAPlayerDir "C:\Program Files\Unity\Editor\Data\PlaybackEngines\MetroSupport".
    1> UnityProjectDir "D:\ChaosGames\Prestation\Dowino\Klesia\test\TestClan".
    1> Copying unprocessed assemblies...
    1> Running AssemblyConverter...
    1> System.ArgumentNullException: La valeur ne peut pas être null.
    1> Nom du paramètre : type
    1> à Mono.Cecil.ModuleDefinition.ImportReference(TypeReference type, IGenericParameterProvider context)
    1> à Mono.Cecil.ModuleDefinition.ImportReference(TypeReference type)
    1> à Unity.ModuleContext.Retarget(TypeReference type, GenericContext context)
    1> à Unity.ModuleContext.Retarget(MethodReference method, GenericContext context)
    1> à Unity.FixReferencesStep.Visit(MethodDefinition method, GenericContext context)
    1> à Unity.FixReferencesStep.Visit(TypeDefinition type)
    1> à Unity.TypeDefinitionDispatcher.DispatchType(TypeDefinition type)
    1> à Unity.TypeDefinitionDispatcher..ctor(ModuleDefinition module, ITypeDefinitionVisitor visitor)
    1> à Unity.FixReferencesStep.ProcessModule()
    1> à Unity.ModuleStep.Execute()
    1> à Unity.FixReferencesStep.Execute()
    1> à Unity.Step.Execute(OperationContext operationContext, IStepContext previousStepContext)
    1> à Unity.Operation.Execute()
    1> à Unity.Program.Main(String[] args)
    1>D:\ChaosGames\Prestation\Dowino\Klesia\test\TestClan\Win10\TestClan\TestClan.csproj(261,5): error MSB3073: The command ""D:\ChaosGames\Prestation\Dowino\Klesia\test\TestClan\Win10\Unity\Tools\AssemblyConverter.exe" -platform=uap -lock="D:\ChaosGames\Prestation\Dowino\Klesia\test\TestClan\Win10\TestClan\project.lock.json" -bits=32 -removeDebuggableAttribute=False -path="." -path="..\Players\UAP\x86\Release" "D:\ChaosGames\Prestation\Dowino\Klesia\test\TestClan\UWP\Assembly-CSharp\bin\x86\Release\Assembly-CSharp.dll" "D:\ChaosGames\Prestation\Dowino\Klesia\test\TestClan\UWP\Assembly-CSharp-firstpass\bin\x86\Release\Assembly-CSharp-firstpass.dll" "D:\ChaosGames\Prestation\Dowino\Klesia\test\TestClan\Win10\TestClan\UnityEngine.dll" "D:\ChaosGames\Prestation\Dowino\Klesia\test\TestClan\Win10\TestClan\UnityEngine.UI.dll" "D:\ChaosGames\Prestation\Dowino\Klesia\test\TestClan\Win10\TestClan\UnityEngine.Networking.dll"" exited with code 1.
    ========== Build: 0 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========
     
  21. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,911
    UWP uses .NET Core, not .NET 3.5. Looking at your errors, it seems you're still trying to use a plugin which is incompatible with UWP. Did you really recompile for UWP?

    To do it:
    * Create class library for UWP, New Project->Visual C#->Universal->Class Library (Universal Windows)
    * Name it as the original plugin
    * Add the necessary files to project
    * Compile
    * You will most likely see compilation errors with API which are not supported by UWP.
     
  22. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    214
    I have recompil but for .NET 3.5 . Then I create a new Project as you mentioned.

    Now it is the word [Serializable] and [SerializeField] that could not be found.I have understand that this is not supported and I must use DataContract.
    But is it compatible with Unity Editor? It is for an object that contains settings for the plugins to works (a login pass for a server connexion)

    ThreadPool, ThreadStart not supported and must use Task
    Stream, HttpWebResponse, HttpWebRequest are partially supported

    It is a 3rd party plugins and I will not rewrite it entierly. :(

    They have a C++ sdk of their lib. Do you think I can add it in my game?

    For instance for the WebGL version of my game I have added their Javascript SDK in the WebGl Template and called function with SendMessage ...

    Is it possible to add their C++ sdk and called to it as native plugin?

    If yes how to do it? But maybe I will have same kind of error?

    They have a WP8 C++ SDK.
     
  23. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,911
    If plugin is used by both editor and player, there should be two versions of them placed in the project (different folders), then one should be marked as compatible with Editor the other one with Windows Store, in the plugin inspector.

    Now for the compile issue, when compiling for UWP...Without fixing those errors, it's a no go. Some of those classes (like Serializable) are implemented in MetroSupport\Managed\UAP\WinRTLegacy.dll, you might want to reference that from your plugin project, maybe it will fix some of those errors.

    Regarding C++ SDK, C++ native plugins are also must be compiled by targeting UWP. New Project->Visual C++->Universal->DLL (Universal Windows). You can still try to use the original C++ dll, but later WACK (Windows Certification Kit) might tell you that dll uses unsupported API.

    SendMessage partially works on WSA, so maybe you can use that... But it's hard to say.

    Try contacting an author of this plugin, and ask them if they have compatible plugin with UWP.
     
  24. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    214
    I have added WinRTLegacy but errors are still here.

    Then I will try with their Rest API and a HttpWebRequest even if partially supported to called their API function.
     
  25. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    214
    Hello,

    I have modified code and compil the Plugin for UWP. Add the dll in a Plugins/WSA folder and set the placeholder.

    Now I export from Unity with many error about UnityWebRequest experimental not found but when I open the visual project and compil the windows 10 app and execute it the game run. The plugin load well. I will install 5.3.4 Patch release to see if errors gone.

    Else I have another problem to deal with and need help.
    The Plugin I use have a class for settings that is a ScriptableObject. This class is sreialized and save as Assets in Resource folder.
    I have modified [Serialize] decoration for [DataAttribute]. I use now DataContract.

    But I do not now how to deal with in Unity Editor. The plugin have an Editor dll. I have recompil it with the settings class with new DataAttribute decoration.

    The Editor Plugin do this:

    s = CreateInstance<CotcSettings>();
    AssetDatabase.CreateAsset(s, CotcSettings.AssetPath);
    s = CotcSettings.Instance;

    I think Unity Serialize automatically.

    And in the Plugin when it load the settings:

    CotcSettings s = Resources.Load(Path.GetFileNameWithoutExtension(AssetPath)) as CotcSettings;


    But I have an error in visual studio console logs:
    A script behaviour (probably CotcSdk.CotcSettings?) has a different serialization layout when loading. (Read 52 bytes but expected 176 bytes)
    Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?

    Thank you for any help.
     
  26. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,735
    What errors do you get for UnityWebRequest?

    Can you show the code for the class you have serialization issues with?
     
  27. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    214
    Unity 5.3.4f1

    First for UnityWebRequest I have error on constructor and other method:
    Kits\10\References\Windows.ApplicationModel.Calls.LockScreenCallContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.ApplicationModel.Resources.Management.ResourceIndexerContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.ApplicationModel.Search.Core.SearchCoreContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.ApplicationModel.Search.SearchContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.ApplicationModel.Wallet.WalletContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Devices.Custom.CustomDeviceContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Devices.Portable.PortableDeviceContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Devices.Printers.Extensions.ExtensionsContract\2.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Devices.Scanners.ScannerDeviceContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Devices.Sms.LegacySmsApiContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Gaming.Preview.GamesEnumerationContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Globalization.GlobalizationJapanesePhoneticAnalyzerContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Management.Deployment.Preview.DeploymentPreviewContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Management.Orchestration.OrchestrationContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Management.Workplace.WorkplaceSettingsContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Media.Capture.AppCaptureContract\2.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Media.Capture.CameraCaptureUIContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Media.Devices.CallControlContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Media.MediaControlContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Media.Playlists.PlaylistsContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Media.Protection.ProtectionRenewalContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Networking.NetworkOperators.LegacyNetworkOperatorsContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Networking.Sockets.ControlChannelTriggerContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Security.EnterpriseData.EnterpriseDataContract\2.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Security.ExchangeActiveSyncProvisioning.EasContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Services.Maps.GuidanceContract\2.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Services.Maps.LocalSearchContract\2.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.System.Profile.SystemManufacturers.SystemManufacturersContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.System.Profile.ProfileHardwareTokenContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.System.Profile.ProfileRetailInfoContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.System.UserProfile.UserProfileContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.System.UserProfile.UserProfileLockScreenContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.UI.ApplicationSettings.ApplicationsSettingsContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.UI.Core.AnimationMetrics.AnimationMetricsContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.UI.Core.CoreWindowDialogsContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.UI.Xaml.Hosting.HostingContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Web.Http.Diagnostics.HttpDiagnosticsContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Devices.DevicesLowLevelContract\2.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.System.SystemManagementContract\2.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.ApplicationModel.Calls.CallsPhoneContract\2.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.ApplicationModel.SocialInfo.SocialInfoContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.ApplicationModel.CommunicationBlocking.CommunicationBlockingContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Devices.SmartCards.SmartCardBackgroundTriggerContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Devices.SmartCards.SmartCardEmulatorContract\2.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Embedded.DeviceLockdown.DeviceLockdownContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Networking.NetworkOperators.NetworkOperatorsFdnContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Phone.PhoneContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.Phone.StartScreen.DualSimTileContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.UI.WebUI.Core.WebUICommandBarContract\1.0.0.0","C:\Program Files (x86)\Windows Kits\10\References\Windows.System.Profile.ProfileSharedModeContract\1.0.0.0" --platform="C:\Program Files (x86)\Windows Kits\10\UnionMetadata\Facade\Windows.winmd" --support="Temp\StagingArea\WinRTLegacy.dll" --supportpartialns=Unity.Partial --system=System --dbg=pdb --lock=UWP\project.lock.json --alt=System.Xml.Serialization;System.Collections,System.Collections.NonGeneric;System.Reflection,System.Reflection.TypeExtensions;System.IO,System.IO.FileSystem;System.Net,System.Net.Primitives;System.Net.Sockets,System.Net.Primitives;System.Xml,System.Xml.XmlDocument --ignore=System.IConvertible,mscorlib.
    Error: method `System.Void UnityEngine.Experimental.Networking.UnityWebRequest::.ctor(System.String)` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Void CotcSdk.UnityHttpClientV2/UnityRequest::.ctor(CotcSdk.UnityHttpClientV2,System.String,CotcSdk.HttpRequest,System.Object,System.Int32).
    Error: method `System.Void UnityEngine.Experimental.Networking.UnityWebRequest::set_method(System.String)` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Void CotcSdk.UnityHttpClientV2/UnityRequest::.ctor(CotcSdk.UnityHttpClientV2,System.String,CotcSdk.HttpRequest,System.Object,System.Int32).
    Error: method `System.Void UnityEngine.Experimental.Networking.UnityWebRequest::SetRequestHeader(System.String,System.String)` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Void CotcSdk.UnityHttpClientV2/UnityRequest::.ctor(CotcSdk.UnityHttpClientV2,System.String,CotcSdk.HttpRequest,System.Object,System.Int32).
    Error: method `System.Void UnityEngine.Experimental.Networking.UploadHandlerRaw::.ctor(System.Byte[])` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Void CotcSdk.UnityHttpClientV2/UnityRequest::.ctor(CotcSdk.UnityHttpClientV2,System.String,CotcSdk.HttpRequest,System.Object,System.Int32).
    Error: method `System.Void UnityEngine.Experimental.Networking.UnityWebRequest::set_uploadHandler(UnityEngine.Experimental.Networking.UploadHandler)` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Void CotcSdk.UnityHttpClientV2/UnityRequest::.ctor(CotcSdk.UnityHttpClientV2,System.String,CotcSdk.HttpRequest,System.Object,System.Int32).
    Error: method `System.Void UnityEngine.Experimental.Networking.UnityWebRequest::set_downloadHandler(UnityEngine.Experimental.Networking.DownloadHandler)` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Void CotcSdk.UnityHttpClientV2/UnityRequest::.ctor(CotcSdk.UnityHttpClientV2,System.String,CotcSdk.HttpRequest,System.Object,System.Int32).
    Error: method `System.Void UnityEngine.Experimental.Networking.UnityWebRequest::Abort()` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Void CotcSdk.UnityHttpClientV2/UnityRequest::AbortRequest().
    Error: method `System.String UnityEngine.Experimental.Networking.UnityWebRequest::get_method()` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Void CotcSdk.UnityHttpClientV2/UnityRequest::LogRequest().
    Error: method `System.String UnityEngine.Experimental.Networking.UnityWebRequest::get_url()` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Void CotcSdk.UnityHttpClientV2/UnityRequest::LogRequest().
    Error: method `System.String UnityEngine.Experimental.Networking.UnityWebRequest::get_method()` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Void CotcSdk.UnityHttpClientV2/UnityRequest::LogResponse(CotcSdk.HttpResponse).
    Error: method `System.String UnityEngine.Experimental.Networking.UnityWebRequest::get_url()` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Void CotcSdk.UnityHttpClientV2/UnityRequest::LogResponse(CotcSdk.HttpResponse).
    Error: method `UnityEngine.AsyncOperation UnityEngine.Experimental.Networking.UnityWebRequest::Send()` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Boolean CotcSdk.UnityHttpClientV2/UnityRequest/<ProcessRequest>d__8::MoveNext().
    Error: method `System.Boolean UnityEngine.Experimental.Networking.UnityWebRequest::get_isError()` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Boolean CotcSdk.UnityHttpClientV2/UnityRequest/<ProcessRequest>d__8::MoveNext().
    Error: method `System.String UnityEngine.Experimental.Networking.UnityWebRequest::get_error()` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Boolean CotcSdk.UnityHttpClientV2/UnityRequest/<ProcessRequest>d__8::MoveNext().
    Error: method `UnityEngine.Experimental.Networking.DownloadHandler UnityEngine.Experimental.Networking.UnityWebRequest::get_downloadHandler()` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Boolean CotcSdk.UnityHttpClientV2/UnityRequest/<ProcessRequest>d__8::MoveNext().
    Error: method `System.Int64 UnityEngine.Experimental.Networking.UnityWebRequest::get_responseCode()` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Boolean CotcSdk.UnityHttpClientV2/UnityRequest/<ProcessRequest>d__8::MoveNext().
    Error: method `System.Collections.Generic.Dictionary`2<System.String,System.String> UnityEngine.Experimental.Networking.UnityWebRequest::GetResponseHeaders()` doesn't exist in target framework. It is referenced from CotcSdk.dll at System.Boolean CotcSdk.UnityHttpClientV2/UnityRequest/<ProcessRequest>d__8::MoveNext().

    UnityEngine.Debug:LogError(Object)
    PostProcessWinRT:RunReferenceRewriter() (at C:/buildslave/unity/build/PlatformDependent/WinRT/SharedSources/CSharp/PostProcessWinRT.cs:579)
    PostProcessWinRT:process() (at C:/buildslave/unity/build/PlatformDependent/WinRT/SharedSources/CSharp/PostProcessWinRT.cs:123)
    UnityEditor.HostView:OnGUI()

    But visual studio project is generated (but not the first-pass, only the main project). I can compil and launch the game.

    Second serialization issue:

    Code (CSharp):
    1. using System;
    2. using System.Collections.Generic;
    3. using System.IO;
    4. using UnityEngine;
    5. using System.Runtime.Serialization;
    6.  
    7. namespace CotcSdk {
    8.  
    9.     /** @cond private */
    10.     [DataContract(Name = "Settings", Namespace = "http://www.clanofthecloud.com")]
    11.     public class CotcSettings : ScriptableObject {
    12.         public const string AssetPath = "Assets/Resources/CotcSettings.asset";
    13.  
    14.         public static CotcSettings Instance {
    15.             get {
    16.                 if (instance == null) {
    17.  
    18. #if WINDOWS_UWP
    19.                     instance = Internal.Serializer.DeSerialization<CotcSettings>(File.ReadAllBytes(AssetPath));
    20. #else
    21.                     instance = Resources.Load(Path.GetFileNameWithoutExtension(AssetPath)) as CotcSettings;
    22. #endif
    23.                 }
    24.                 return instance;
    25.             }
    26.         }
    27.  
    28.         private static CotcSettings instance;
    29.  
    30.         [DataContract(Name = "Environment", Namespace = "http://www.clanofthecloud.com")]
    31.         public class Environment {
    32.             [DataMember()]
    33.             public string Name;
    34.             [DataMember()]
    35.             public string ApiKey;
    36.             [DataMember()]
    37.             public string ApiSecret;
    38.             [DataMember()]
    39.             public string ServerUrl;
    40.             [DataMember()]
    41.             public int LbCount = 1;
    42.             [DataMember()]
    43.             public bool HttpVerbose = true;
    44.             [DataMember()]
    45.             public int HttpTimeout = 60;
    46.             [DataMember()]
    47.             public int HttpClientType = 0;
    48.         }
    49.  
    50.         [DataMember()]
    51.         public int FileVersion = 2;
    52.         [DataMember()]
    53.         public List<Environment> Environments = new List<Environment>();
    54.         [DataMember()]
    55.         public int SelectedEnvironment = 0;
    56.     }
    57.     /** @endcond */
    58. }
    59.  
    Iam adding a Serializer class utility to serialize and deserialize.But I do not know how to add a TextAsset in Asset Database with my own serializer that used DataContractSerializer. Because this code
    AssetDatabase.CreateAsset(myclassinstanceOfCotcSettings, CotcSettings.AssetPath); should not works (or maybe should if UnityEngine use DataContractSerializer if we use DataMember decoration?)

    Maybe I can create a TextAsset in other way?
     
  28. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,735
    EDIT: UnityWebRequest is no longer experimental, so your plugin is probably out of date (compiled against old UnityEngine.dll). If compiling with newest UnityEngine.dll does not solve this issue, then report a bug.

    As for serialization, I believe you should read file using absolute path on UWP, not relative one. You may also need to put that file in StreamingAssets directory, see http://docs.unity3d.com/ScriptReference/Application-streamingAssetsPath.html
     
    Last edited: May 18, 2016
  29. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    214
    I will test absolute path.

    But I am not sure that will works because The Plugin use Unity function to create a file in Resources folder with Unity.CreateAsset function. In the editor I use the plugin placeholder compile for ios, android, .... with [Serializable] C# decoration

    But when I run the game I use the plugin I have recompil for UWP with DataContractor API .

    What about serialization and deserialization with two different ways? Anybody have try it before?

    (sorry for my frenglish)
     
  30. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,735
    Is it something you serialize one way and deserialize with the other. I strongly don't recommend that, better use something that works on all platforms.
     
  31. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    214
    I cant. System.Serialize is not supported on UWP. Right?
     
  32. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,678
    [Serializable] and [SerializeField] work just fine on UWP.
     
  33. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    214
    Ho great. Indeed I try it and it works fine. I do not know why I have understood that System.Serialize was not present in UWP. But it is. great.

    Now I must modify the inclusion UnityEngine.Experimental.Networking.UnityWebRequest that is not Experimental since 5.3. But when I modify it in the plugins code I have a missing ref. I have include UnityEngine.dll that is in folder C:\Program Files\Unity\Editor\Data\Managed

    Is it the godd dll to include to build UWP Plugins with Unity 5.3.5f1?
     
  34. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    214
    I found another DLL: C:\Program Files\Unity\Editor\Data\UnityExtensions\Unity\Networking\UnityEngine.Networking.dll

    But still the error.
     
  35. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    214
    In Unity 5.3.5f1 seems to be in UnityEngine.Experimental.Networking . When I compil the UWP plugins all is OK. But when I compil my game with the plugins errors occured. And at runtime the UnityWebRequest is not found.

    How to solve it?

    Edit: UnityWebRequest is in namespace UnityEngine.Experimental.Networking for the 5.3.5f1. Ok. The error occured when I export the project for UWP visual studio build.

    One message error: Reference rewriter: Error: method `System.Void UnityEngine.Experimental.Networking.UnityWebRequest::.ctor(System.String)` doesn't exist in target framework.

    It is like does not exists for Windows Apps. But in documentation I have read that supports have been added since 5.3.x
     
    Last edited: Jun 10, 2016
  36. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,678
    Do you just have the plugin DLL or do you have its source code too?
     
  37. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    214
    I have the source of the plugin and recompil it for UWP modifying some ligne of codes.


    At runtime on my windows 10 pc I have this error when trying to use connexion:

    MissingMethodException: Method not found: 'Void UnityEngine.Experimental.Networking.UnityWebRequest..ctor(System.String)'.
     
  38. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    214
    Some logs at start of the App from visual studio 2015:


    Module information:
    Built with Compiler Ver '190023026'
    Built from '5.3/release' branch
    Version is '5.3.5f1 (960ebf59018a)'
    Release build
    Application type 'XAML'
    Used 'UWP'

    Exception thrown: 'System.FormatException' in mscorlib.ni.dll
    PlayerConnection initialized from D:/ChaosGames/Prestation/Dowino/Klesia/test/TestClan/Win10/TestClan/bin/x86/Release/AppX/Data (debug = 0)

    PlayerConnection initialized network socket : 0.0.0.0 55351

    Multi-casting "[IP] 192.168.0.2 [Port] 55351 [Flags] 2 [Guid] 4205937602 [EditorId] 4294967295 [Version] 1048832 [Id] MetroPlayerX86(DESKTOP-MBNO0LC) [Debug] 0" to [225.0.0.222:54997]...

    GfxDevice: creating device client; threaded=1

    Disabling Low Latency presentation API.

    Direct3D:

    Version: Direct3D 11.0 [level 11.0]

    Renderer: AMD Radeon (TM) R7 360 Series (ID=0x665f)

    Vendor: ATI

    VRAM: 2026 MB

    Initialize engine version: 5.3.5f1 (960ebf59018a)


    As you can see mscorlib.ni.dll raised an exception
     
  39. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,678
    When building for UWP, reference this UnityEngine.dll, rather than the editor one: Editor\Data\PlaybackEngines\MetroSupport\Managed\UAP\UnityEngine.dll.
     
  40. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    214
    Ok, constructor and some method differ. Why?

    It will be fixed in 5.4?
     
  41. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,678
    What differs exactly?
     
  42. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    214
    The doc does not say that there are limitation with Windows 10 plateforme: http://docs.unity3d.com/Manual/UnityWebRequest.html

    Sample show how to create new UnityWebRequest(string) .

    Then no HLAPI Post Get ....

    Unusable.

    I do not know I will build the release :(


    Edit:

    error CS1729: 'UnityWebRequest' does not contain a constructor that takes 1 arguments
    'UnityWebRequest' does not contain a definition for 'method'
    'UploadHandlerRaw' does not contain a constructor that takes 1 arguments
    ....
     
  43. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    214
    Must I redownload Windows Support with the unity download assistant?
     
  44. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,678
    Yeah, those methods were added to Windows Store version in 5.4.
     
  45. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    214
    Ok can I release a game in production with the 5.4 Beta?
     
  46. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,678
    Yes. If it works for you :).