Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Reference Rewriter found some errors while running with command --target="Temp\StagingArea\UnityEtx.

Discussion in 'Windows' started by ZalmakiZ, Apr 28, 2016.

  1. ZalmakiZ

    ZalmakiZ

    Joined:
    May 20, 2015
    Posts:
    9
    [OT] is it ok to just name the title of the post like an Error message?

    Hey,ppl and Uniter´s

    After alot time of Porting code to make it Windows 10 store (UWA) compatible, we now run into this problems :(

    the big and monstrous error message is:
    Reference Rewriter found some errors while running with command --target="Temp\StagingArea\UnityEtx.dll" --additionalreferences="Temp\StagingArea","C:\Program Files (x86)\Windows Kits\10\UnionMetadata\Facade","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: method `System.Void System.IO.StreamWriter::.ctor(System.String)` doesn't exist in target framework. It is referenced from UnityEtx.dll at System.Boolean UnityEtx.UnityCSLiveServicesDynamicEventWrapper::Generate(System.String).
    Error: method `System.Text.Encoding System.Text.Encoding::get_Default()` doesn't exist in target framework. It is referenced from UnityEtx.dll at System.Boolean UnityEtx.XCEFile::parseXml(System.String).

    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 there are also alot of other smaller errors (12 of them) where i got no clue what they saying like this one:
    as far as i understand that one is trying to tell me that i cant use a StreamWriter in a UWA project, well thats fine but i searched through the whole project and cant find any usage of StreamWriter at all, so why is it crying about that one?



    Unity version 5.3.4f1
    Building with a clean project (just a cube) works fine.
     
  2. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,722
    The error messages also give the dll files using those APIs. You are using plugins that use those APIs.
     
  3. ZalmakiZ

    ZalmakiZ

    Joined:
    May 20, 2015
    Posts:
    9
    oh yes, thank you very much.
    After that long time of searching, i tend to oversee the most simple stuff =)
     
  4. ofitz

    ofitz

    Joined:
    Mar 23, 2017
    Posts:
    1
    I have the same problem, but i dont know how can i solve it, can you give me a answer how do you solved it?
     
  5. djstatika

    djstatika

    Joined:
    Jul 6, 2017
    Posts:
    4
    Are you basically saying you cant export to windows store/xbox one if you are using DLLs?
     
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,644
    Using DLLs is fine. What you cannot do is use DLLs that use unavailable APIs. This limitation exists for all platforms, however, if you're using .NET scripting backend on UWP, the API surface is a little bit different than what you get on other platforms. If you use IL2CPP scripting backend on UWP, the API surface is practically identical to other Unity platforms.
     
  7. Flamesky

    Flamesky

    Joined:
    Jan 28, 2015
    Posts:
    13
    Hello, Now the version unity2017 has coming up, but uwp still lost a lot api on unity engine, but I use vs2017 to create a uwp project, it can use a lot api that ever can't. Is these unity's problem? could you add these new features on the new Unity?
     
  8. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,644
    We have no plans of doing that currently, as we're in process of deprecating .NET scripting backend anyway. You can switch to IL2CPP and enjoy the full .NET 4.6 experience if you wish.
     
  9. Flamesky

    Flamesky

    Joined:
    Jan 28, 2015
    Posts:
    13
    Hi, I try to switch to IL2CPP, and it can be import uwp project, but when I run in vs2017 with local machine, some error always happen, such as TcpClient, Unity.Networking, and so on.. hope you will fixed these api on uwp, thank you..
     
  10. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,644
    What kind of errors are you getting? TcpClient and Unity.Networking should work just fine on IL2CPP.
     
  11. Flamesky

    Flamesky

    Joined:
    Jan 28, 2015
    Posts:
    13
    I Create a null Unity2017 project, and build for uwp, then when I build it in vs2017 with local machine or arm device, it always show these errors, see below picture. and the project without any C# code, my unity version is the personal one, how could I solve the problem, and I ever build il2cpp with unity 5.5, it can be run in my win10, and now I can't test whether is the TcpClient can be use, but UnityEngine.Network must not use on uwp platform, no matter on .net or il2cpp. Hope you will fix these. 3q
     

    Attached Files:

  12. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,644
  13. Flamesky

    Flamesky

    Joined:
    Jan 28, 2015
    Posts:
    13
  14. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,644
    Well does Shlobj.h exist on your machine then? Because that comes from Windows SDK.
     
  15. lust0yixiong

    lust0yixiong

    Joined:
    Aug 1, 2017
    Posts:
    1
    I have met the same question, did you ever solvered this issue?