Over a million developers have joined DZone.

Fixing the ''...Unity\Tools\AssemblyConverter.exe exited with code 1'' Error in Mixed Reality Apps

DZone 's Guide to

Fixing the ''...Unity\Tools\AssemblyConverter.exe exited with code 1'' Error in Mixed Reality Apps

If you're a mixed reality developer using Unity, you may have run into this error. See how this developer fixed the problem.

· Performance Zone ·
Free Resource

It's not easy being green - I mean, a Mixed Reality developer.

This is one that has annoyed me for quite some time. When developing a Mixed Reality app, I usually go like this:

  • Change something in Unity.
  • Build the Mixed Reality app from Unity.
  • Open Visual Studio.
  • Build the app and run in a HoloLens or Immersive headset.
  • Be not entirely satisfied with the result.
  • Change something more in Unity.
  • Build the Mixed Reality app again.

And then something like this happens:

An extremely unhelpful error message. If you copy the whole command in a command line and run the command yourself, you get a little more info:

System.Exception: Unclean directory. Some assemblies are already converted, others are not.
at Unity.SanityCheckStep.Execute()
at Unity.Step.Execute(OperationContext operationContext, IStepContext previousStepContext)
at Unity.Operation.Execute()
at Unity.Program.Main(String[] args)

So, here's a clue. Apparently, some cruft stays behind preventing Unity from rebuilding the app the second time around. This is because Unity does not always overwrite all the files, presumably to speed up the build process that second time. Only, apparently, they mess up sometimes.

So then you go delete your generated app, but don't forget to retain some files you might want to keep (like your manifest file). You might add those to your repo - but then don't forget to revert after deleting, and oh yes, if you are testing on your local machine (and not your HoloLens or a different machine) you might find you can't even delete everything because it's locked. So you need to uninstall the app first. And this happens every second time you compile the app. And yes, this also happens when you use the Build Window.

Meh indeed.

I never thought I would ever write this sentence, but here it goes:

PowerShell to the Rescue

You only need to do this first step when you are testing on your development machine, and not on a HoloLens.

We need to find out what the actual package name of your app is. The are two ways to do this. The simplest one is going over to your package.appxmanifest, double-click it, and select the tab "packaging."

Or you can just run a PowerShell Command like this:

Find name : Get-AppxPackage | Where-Object {$_ -like "*Walk*"}

Then you can make a script, call it "CleanApp.ps1" (or whatever you want to call it), and add the following commands:

Get-AppxPackage 99999LocalJoost.ThisIsMyApp | Remove-AppxPackage

$PSScriptRoot = Split-Path -Parent -Path $MyInvocation.MyCommand.Definition ` Get-ChildItem -Path ${PSScriptRoot}\App\ ` -include *.dll,*.pdb,*.winmd,*.pri,*.resw,Appx -Recurse | ` Remove-Item -Force -Recurse

This assumes your generated app is sitting in a directory "App" that is a subdirectory of the directory that the actual script is sitting in. It typically places this in the root of the (Unity) project, while the App folder is a subdirectory of that.

So, your typical workflow now becomes:

  • Change something in Unity.
  • Run this script.
  • Then, continue building the Mixed Reality app as you see fit (either from Unity to Visual Studio, or directly from the Build Window).

I deem you all capable of copying these lines of code from this blog post, so I won't put any code online to go with this article.

performance ,debugging ,errors ,mixed reality

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}