File.Copy returns error 317 ERROR_MR_MID_NOT_FOUND on Windows 11 22H2

Thomas 16 Reputation points
2022-11-15T10:35:41.437+00:00

We use a 32bit Outlook VSTO, we make a copy of an email using interop and then we use File.Copy() to copy this email to another location. Seemlingly randomly, the message "System.IO.IOException: The message text associated with number 0x%1 cannot be found in the message file for %2." is displayed.

We have several customers reporting the error and it is only reproducible on Windows 11 22H2. We managed to reproduce it on build 10.0.22621.819.

Does anyone have any idea why File.Copy is returning ERROR_MR_MID_NOT_FOUND ?

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,219 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,473 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
8,124 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Oskar Shon 866 Reputation points MVP
    2022-11-15T15:47:36.883+00:00

    If you open this mail (saved as file) then 'll will be held until system reset unless you find a handle in processes and release it.
    I check that for msg Outlook export file.

    0 comments No comments