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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

UWP - Failed to resolve type System.ICloneable

Discussion in 'Windows' started by Bocci, Nov 19, 2018.

  1. Bocci

    Bocci

    Joined:
    Sep 7, 2013
    Posts:
    15
    We have an issue building an application for the Hololens using 2017.4.3f1 with .NET backend.

    All the previous builds worked fine, but now we are getting this error when deploying to the hololens.

    3> Copying unprocessed assemblies...
    3> Running AssemblyConverter...
    3> System.Exception: Failed to resolve type System.ICloneable. Is type unavailable in target framework?
    3> at Unity.MetadataContainer.ResolveType(TypeReference type)
    3> at Unity.MetadataContainer.GetAssemblyForType(TypeReference type)
    3> at Unity.AssemblyWrapper.AddType(TypeReference type)
    3> at Unity.AssemblyWrapper.AddType(TypeReference type)
    3> at Unity.AssemblyWrapper.AddType(TypeReference type)
    3> at Unity.AssemblyWrapper.CreateMethodWrapper(MetadataContainer metadata, TypeWrapper typeWrapper, MethodDefinition method)
    3> at Unity.AssemblyWrapper.GetCallableMethods(TypeWrapper typeWrapper, TypeDefinition type, Boolean publicOnly)
    3> at Unity.AssemblyWrapper.AddType(TypeReference type)
    3> at Unity.GetTypesStep.Visit(TypeDefinition type)
    3> at Unity.TypeDefinitionDispatcher.DispatchType(TypeDefinition type)
    3> at Unity.TypeDefinitionDispatcher..ctor(ModuleDefinition module, ITypeDefinitionVisitor visitor)
    3> at Unity.GetTypesStep.ProcessModule()
    3> at Unity.ModuleStep.Execute()
    3> at Unity.Step.Execute(OperationContext operationContext, IStepContext previousStepContext)
    3> at Unity.Operation.Execute()
    3> at Unity.Program.Main(String[] args)
    3>D:\App_7be710e\GISapp_test\GISapp_test.csproj(468,9): error MSB3073: The command ""D:\App_7be710e\Unity\Tools\AssemblyConverter.exe" -platform=uap -lock="D:\App_7be710e\GISapp_test\project.lock.json" -bits=32 -configuration=Debug -removeDebuggableAttribute=False -uwpsdk=10.0.17134.0 -path="." -path="F:\Program Files\Unity\2017.4.3f1\Editor\Data\PlaybackEngines\MetroSupport\Players\UAP\dotnet\x86\Debug" "D:\App_7be710e\GISapp_test\Assembly-CSharp-firstpass.dll" "D:\App_7be710e\GISapp_test\Assembly-CSharp.dll" "D:\App_7be710e\GISapp_test\UnityEngine.StyleSheetsModule.dll" "D:\App_7be710e\GISapp_test\UnityEngine.TerrainModule.dll" "D:\App_7be710e\GISapp_test\UnityEngine.TerrainPhysicsModule.dll" "D:\App_7be710e\GISapp_test\UnityEngine.TextRenderingModule.dll" "D:\App_7be710e\GISapp_test\UnityEngine.TilemapModule.dll"
    .........

    The changes from the previous build are minimal, we just added a couple of scripts and modified the scene. Nothing that has to do with the ICloneable interface and yet we get that blocking error! We have gone through all the dependencies, checked if some plugin settings were changed, updated nugets but nothing solved the issue. This is a screen grab of the commit, just to give an idea (obviously no script added uses the ICloneable interface):

    upload_2018-11-19_16-45-57.png

    Does somebody has any idea what could cause the issue?
    Thanks!
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,518
    Did you modify the generated VS project after it has been created by Unity? Does building to an empty folder fix this?
     
  3. Bocci

    Bocci

    Joined:
    Sep 7, 2013
    Posts:
    15
    No I didn't touch it. Anyways how could I check it, because something went clearly wrong, because comparing the 2 versions (the working one and the broken one) I can't see any difference.

    I already tried to build to new folders, but it doesn't fix it.
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,518
    Are you positive that that's the exact change that broke it? Do you have any errors in the editor console when building the game in Unity (before you even open VS)?
     
  5. Bocci

    Bocci

    Joined:
    Sep 7, 2013
    Posts:
    15
    Yes I'm positive, the commit shows that it's only a couple of scripts that I added.
    No I don't have any errors in the console, it builds just fine but when I deploy it gives me the error in the OP.
     
  6. Bocci

    Bocci

    Joined:
    Sep 7, 2013
    Posts:
    15
    Ok I found the culprit:
    In the scripts I added I used a DLL that used conditional compilation symbol to exclude ICloneable. But it seemed that it wasn't picked up when deploying the solution from the Unity generated project, generating the error (maybe because the DLL was marked as "Don't process"?)

    Anyways thanks Tautvydas for the support!