BadImageFormatException while building an UWP unit test project

I'm pretty consistently suffering from BadImageFormatExceptions while loading System.Private.CoreLib needed to build a UWP unit test project. Is it possible that nuget package cache is corrupted somehow? Something similar was mentioned here https://developercommunity.visualstudio.com/content/problem/7418/re..., but was resolved using an install/uninstall.

Please see the failing build here https://ci.appveyor.com/project/dennisdoomen/fluentassertions/build...

  1. Install/uninstall VS 2017?

  2. Not sure. It seems the DLLs have been downloaded from Nuget but ended up in the appveyor's account cache. Any change you can clean that folder. I'm trying to debug it using remote desktop, but I can't get in.

  3. Try cleaning up that folder during the build:

    install:
    - rd /s /q C:\Users\appveyor\.nuget\packages\
    

    Let me know if that worked.

  4. Didn’t make a difference. To try a more isolated situation, I’ve created a clean UWP test project with a Cake build script. Also doesn’t work because something is wrong with some CLR assemblies. See https://ci.appveyor.com/project/dennisdoomen/appveyortest

    Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

  5. Have you tried creating UWP project without Cake to see if that works? Also, I'm not sure yet, but don't you think that UWP tests can only be run on Windows 10 (non-Server OS)?

  6. Dennis Doomen

    [cid:[email blocked]]
    M

    +31 (0)6-47033908

    From: Feodor Fitsner [mailto:[email blocked]]
    Sent: Tuesday, March 21, 2017 1:20 AM
    To: Dennis Doomen <[email blocked]>
    Subject: Re: BadImageFormatException while building an UWP unit test project [Questions #3501]

    Yep, tried that, but it won’t even compile because nuget restore doesn’t work out of the box.

    Are you running your build agents on Windows Server 2016? Because that’s supposed to work.

  7. Visual Studio 2017 image runs on Windows Server 2016.

  8. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:15 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions