John J Scott Posted November 15, 2023 Share Posted November 15, 2023 The error:"The active test run was aborted. Reason: Test host process crashed : Process terminated. MVID mismatch between loaded assembly 'System.Private.Xml' (MVID = {4007EC53-119A-4580-9B7F-C8A4BBCDB0E0}) and version of assembly 'System.Private.Xml' expected by assembly 'PaintDotNet.Data' (MVID = {405DEE27-471D-48E3-8C64-1D8278CF1FDD})" I'm not sure whether this is a problem for Paint.NET or Microsoft, but finding a workaround on these forums seems plausible. Unit tests have been working fine for a long time, but yesterday I updated Visual Studio 2022 to the latest version, and apparently this updated the Xml assembly used in the test adapter to a different one that is used in Paint.NET. (That's how I'm reading it anyway). Why this crashes is anybody's guess. I speculate that a recompile of Paint.NET would fix the issue? In the meantime, is there a workaround? Some form of assembly forwarding? Is there a way to make Paint.NET (or MS test adapter for that matter) less strict on the required assemblies? Cheers John Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted November 15, 2023 Share Posted November 15, 2023 Why are you using Paint.NET in a test adapter? What is the context here? Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
John J Scott Posted November 15, 2023 Author Share Posted November 15, 2023 I've written a container format for compressed texture formats used in graphics hardware (think DDS format but with extra features). Part of the suite is that these can be loaded directly into Paint.NET for viewing. The general test process in C++ is: Load PNG Add mip maps, convert to a compressed texture format (e.g. BC1/DXT1), and save as DDS. Convert to my format and save. Load in my format and make sure it matches the DDS. Then the test process in C#: Load PNG Load my format version Use the Paint.NET file type code to decompress my format to RGBA and make sure it matches the PNG. As I've been working on this for a while, I tend to be a bit too succinct 😃 Is that a suitable explanation? Cheers John Quote Link to comment Share on other sites More sharing options...
Solution Rick Brewster Posted November 16, 2023 Solution Share Posted November 16, 2023 I have no idea why the test adapter is failing like that. Others have seen that same MVID error pop up sometimes when trying to use the WinForms Designer inside of Visual Studio, and it was completely vexing then too. There's something about the way these hosts are loading DLLs that just doesn't work. I'm pretty sure it's a Microsoft bug. Also, I need to make sure you know that Paint.NET's DLLs are not licensed for redistribution or integration -- I'm not worried if you're doing automated tests on your own PC as part of developing a FileType plugin, but you can't (for example) put Paint.NET's DLLs into a public git repo, or use it in a CI system, or bundle it within your own apps or services, etc. Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
John J Scott Posted November 16, 2023 Author Share Posted November 16, 2023 Quote I'm pretty sure it's a Microsoft bug. Probably - just looking for a workaround from a responsive team. No replies from MS as yet. Quote Paint.NET's DLLs are not licensed for redistribution or integration They are not in source control, just referenced by the csproj files and VS makes a local copy for reasons that are known only to Microsoft. The only limitation with this is that Paint.NET needs to be installed to the default location ("C:\Program Files\paint.net") for that 'just works out of the box' experience. Cheers John 1 Quote Link to comment Share on other sites More sharing options...
John J Scott Posted December 9, 2023 Author Share Posted December 9, 2023 The latest Paint.Net release on December 1st to 5.0.12 made the problem go away. Well, until Microsoft repeat the problem anyway. Cheers John Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.