I am use latest Magick.NET-16-AnyCPU library only for loading images in different formats, init code is:
```
StartupPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string TempDirectory = Path.Combine(StartupPath, "Temp");
if (!Directory.Exists(TempDirectory))
Directory.CreateDirectory(TempDirectory);
MagickAnyCPU.CacheDirectory = StartupPath;
MagickAnyCPU.HasSharedCacheDirectory = false;
MagickNET.SetTempDirectory(TempDirectory);
/* int[] A = new int[1]; //VS stop Debug there!!!
A[4] = 0; */
```
as result if program have some exception before "MagickNET.SetTempDirectory(TempDirectory);", debug stopped at line with it, else (after SetTempDirectory) - see attached ScreenShot.
Comments: As you can see you are getting an exception in your own code. The "CacheDirectory screenshot" works perfectly but your code is invalid: ``` int[] A = new int[1]; A[100] = 12345; ``` Your array 'A' only has room for one item and you are adding something at the index 100.
```
StartupPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string TempDirectory = Path.Combine(StartupPath, "Temp");
if (!Directory.Exists(TempDirectory))
Directory.CreateDirectory(TempDirectory);
MagickAnyCPU.CacheDirectory = StartupPath;
MagickAnyCPU.HasSharedCacheDirectory = false;
MagickNET.SetTempDirectory(TempDirectory);
/* int[] A = new int[1]; //VS stop Debug there!!!
A[4] = 0; */
```
as result if program have some exception before "MagickNET.SetTempDirectory(TempDirectory);", debug stopped at line with it, else (after SetTempDirectory) - see attached ScreenShot.
Comments: As you can see you are getting an exception in your own code. The "CacheDirectory screenshot" works perfectly but your code is invalid: ``` int[] A = new int[1]; A[100] = 12345; ``` Your array 'A' only has room for one item and you are adding something at the index 100.