Problem saving data with program written in MonoGame under VS2022.

My simulation program is written in XNA 4.0 under VS2010 and works perfectly. However, I ported it to MonoGame under VS2022 and when it tries to save data (.txt file) in a new directory I get the exception “System.IO.DirectoryNotFoundException: 'Could not find a part of the path 'C:\Something”. The directory is created correctly but the file of course not.
Please help!
HR
Netherlands

Share your code. As minimally as possible, just the section you’re asking about.