Search Unity

UWP - AssemblyConverter running on already processed assemblies

Discussion in 'Windows' started by sergio_pixeltoys, Jun 26, 2017.

  1. sergio_pixeltoys

    sergio_pixeltoys

    Joined:
    Feb 17, 2016
    Posts:
    2
    Hello,

    I'm encountering a really weird issue with Unity 5.6.1p4 + Visual Studio 2017 Community, both recently upgraded from earlier versions.

    My project exports from Unity and runs perfectly fine in Visual Studio the first time I do it, but if I make a quick change in the managed code and re-export from Unity it will always fail to rebuild the VS project with this error:

    The only effective workaround seems to be to completely delete every trace of the previously exported VS project before exporting from Unity.

    I am currently modifying some of the VS project files during a late post processing step, but it was working flawlessly before I upgraded from 5.4.3p4 to 5.6.1p4.

    Is this a bug with Unity or Visual Studio 2017?
     
  2. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,735
    It's hard to say exactly, but there is an issue with VS solution. It could be VS bug, or it could be Unity does not generate the solution correctly and build events are not run correctly.
    Which config are you using in VS?
    This sanity check prevents build in Master configuration, but it should build fine in Debug. Don't remember regarding Release.
     
  3. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    I am betting this modification is going wrong somehow. I'd diff the project files before and after the modification, and see if you're not nuking any sections Unity generates.
     
  4. sergio_pixeltoys

    sergio_pixeltoys

    Joined:
    Feb 17, 2016
    Posts:
    2
    I completely exclude this case, as our post-processing scripts are adding specific lines to the following files:
    - App.xaml.cs
    - ProjectName.csproj
    - Package.appxmanifest
    - MainPage.xaml.cs
    - Default.rd.xml

    The purpose of those changes is to automate the Visual Studio setup when using a build machine, to add native crash reporting support and to make minor fixes to have it compiling.

    One of the reasons we had to do this was to explicitly specify supported languages, as the automatic recognition was listing languages such as Afrikaans just to fail exporting a store package because it couldn't find any resources for that language.

    We are using the Release configuration, as the Debug one has way too much overhead to run smoothly enough to get a reliable test flow. Release is a good compromise between being able to get meaningful logs and being close to final performances.

    I have an update, maybe it would be the case to handle this in a different thread:
    Loading a pre-update branch in the same machine with our previous configuration (Unity 5.4.3p4 + Visual Studio 2015) now refuses to compile and complains about not being able to find any previously defined NETFX_CORE classes such as IXmlNode, WebView, UnicodeEncoding and so on.

    The upgrade process consisted in installing Unity 5.6.1p4 and the version of Visual Studio it carried with it, then exporting from Unity, opening the project with VS and installing the additional required packages to run it.

    One of these steps seems to have compromised my capability of building for UWP with Unity 5.4.3p4.
     
  5. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,735
    Try disabling all your post processing, export solution and make a copy of .csproj file.
    Then do the same with your post processing enable.
    Compare both files, build evens to be exact. Could be that some custom events added by Unity are damaged.
     
  6. hichamoussa

    hichamoussa

    Joined:
    Jan 22, 2014
    Posts:
    3
    I have exactly the same problem with version 2017.1, has anyone found a solution?
     
  7. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Are you modifying the VS project after Unity exports it?
     
  8. hichamoussa

    hichamoussa

    Joined:
    Jan 22, 2014
    Posts:
    3
    No I had made no changes in the VS Project.
    But I can reproduce the problem now.

    - Delete the UnityOverwrite.txt file (located in the same level of .sln file).
    - Build the solution from unity. (Unity will create the UnityOverwrite.txt with keyword 'keep-all' inside)
    - Make a build of VS solution.

    - CMD Output result:

    System.Exception: AssemblyConverter running on already processed assemblies. There is something wrong with your build.
    At Unity.SanityCheckStep.Execute ()
    At Unity.Step.Execute (OperationContext operationContext, IStepContext previousStepContext)
    At Unity.Operation.Execute ()
    At Unity.Program.Main (String [] args)
     
  9. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,735
    If you delete just UnityOverwrite.txt and nothing else, Unity assumes the old project from before the days when this overwrite control file was introduced and uses the behavior from back then, which not to not touch any customizable files.
    However, that doesn't explain why this issue happens.
    Does this issue happen if you:
    - make a clean build to an empty directory
    - build solution in VS
    - remove UnityOverwrite.txt file
    - build from Unity again on top of this solution
    - build in VS again
     
  10. hichamoussa

    hichamoussa

    Joined:
    Jan 22, 2014
    Posts:
    3
    I have tested exactly the steps that you quoted above in Release mode, yes I have the issue.
     
  11. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,735
    Please report a bug for that.