Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

[Solved] Failed to run assembly converter with command line -platform=wp80

Discussion in 'Windows' started by StaticClass, Mar 5, 2015.

  1. StaticClass

    StaticClass

    Joined:
    Jan 31, 2014
    Posts:
    12
    Dev OS: Windows 8
    IDE: Visual Studio 2013
    Unity player: WP8

    Hello. So far I had no problems with building to Windows Phone in Unity 4.
    Yesterday I tried to port my project to Unity 5 (Personal) and while building I get this error:

    Error building Player: Exception: Failed to run assembly converter with command line -platform=wp80 "Temp/StagingArea\Assembly-CSharp.dll" "Temp/StagingArea\UnityEngine.dll" "Temp/StagingArea\UnityEngine.UI.dll" "Temp/StagingArea\WinRTLegacy.dll".
    System.ArgumentException: Member 'System.Void System.ArgumentOutOfRangeException::.ctor(System.String)' is declared in another module and needs to be imported
    at Mono.Cecil.MetadataBuilder.LookupToken(IMetadataTokenProvider provider)
    at Mono.Cecil.Cil.CodeWriter.WriteOperand(Instruction instruction)
    at Mono.Cecil.Cil.CodeWriter.WriteInstructions()
    at Mono.Cecil.Cil.CodeWriter.WriteResolvedMethodBody(MethodDefinition method)
    at Mono.Cecil.Cil.CodeWriter.WriteMethodBody(MethodDefinition method)
    at Mono.Cecil.MetadataBuilder.AddMethod(MethodDefinition method)
    at Mono.Cecil.MetadataBuilder.AddMethods(TypeDefinition type)
    at Mono.Cecil.MetadataBuilder.AddType(TypeDefinition type)
    at Mono.Cecil.MetadataBuilder.AddTypeDefs()
    at Mono.Cecil.MetadataBuilder.BuildTypes()
    at Mono.Cecil.MetadataBuilder.BuildModule()
    at Mono.Cecil.ModuleWriter.<BuildMetadata>b__0(MetadataBuilder builder, MetadataReader _)
    at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TItem item, Func`3 read)
    at Mono.Cecil.ModuleWriter.BuildMetadata(ModuleDefinition module, MetadataBuilder metadata)
    at Mono.Cecil.ModuleWriter.WriteModuleTo(ModuleDefinition module, Stream stream, WriterParameters parameters)
    at Mono.Cecil.ModuleDefinition.Write(Stream stream, WriterParameters parameters)
    at Mono.Cecil.ModuleDefinition.Write(String fileName, WriterParameters parameters)
    at Unity.SaveModulesStep.ProcessModule()
    at Unity.ModuleStep.Execute()
    at Unity.Step.Execute(OperationContext operationContext, IStepContext previousStepContext)
    at Unity.Operation.Execute()
    at Unity.Program.Main(String[] args)

    This is the error that my main project shows.
    I did a little test after that with a dummy project with only two scripts and it builds just fine.

    Please, can you tell me more about this error and the ways to fix it? Thank you guys.
     
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,956
    Do you use ArgumentOutOfRangeException in your script? A bug with repro project attached would be nice.
     
  3. StaticClass

    StaticClass

    Joined:
    Jan 31, 2014
    Posts:
    12
    I have more than 90 scripts in my project and no, I am not using ArgumentOutOfRangeException.
     
  4. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,783
    I think ArgumentOutOfRangeException is used in code, generated by AssemblyConverter.
    Please, report a bug.
     
  5. StaticClass

    StaticClass

    Joined:
    Jan 31, 2014
    Posts:
    12
    Bug reported.
     
  6. StaticClass

    StaticClass

    Joined:
    Jan 31, 2014
    Posts:
    12
    Problem is now solved and fixed with Patch 5.0.1p1.
     
    Last edited: Jan 26, 2020