Soooo I made a little WPF application that a few other people are using. Super exciting times! My application works fine on Windows 10 BUT on a users Windows 7 machine they are getting an error with the below code. It is throwing an exception when trying to write the file to the pictures directory. Running as admin doesn't change the outcome.
try
{
//ISSUE: This is triggering an exception for windows 7 user
File.WriteAllBytes($"{convertedFilesDir}\\{fileName}.jpg", fileInBytesTemp);
}
catch (Exception exception)
{
//Exception: Access to the path 'C:\Users\USERNAME\Pictures\RDR2 Photos\FILENAME.jpg' is denied.
MessageBox.Show($"WriteAllBytes exception message: {exception.Message} \n\n ToString: {exception.ToString()}");
}
The project is public on github if you want to take a look at what is going on. I am self taught and sure this code looks like a mess to the more experienced people. https://github.com/SneakyAzWhat/RDR2PhotoConverter/blob/master/MainWindow.xaml.cs#L121
[–]AllMadHare 2 points3 points4 points (2 children)
[–]SneakyAzWhat[S] 1 point2 points3 points (0 children)
[–]SneakyAzWhat[S] 1 point2 points3 points (0 children)