How to use temporary-path from C# code? (windows)

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Post Reply
Ljurka
Posts: 4
Joined: 2018-07-01T13:53:12-07:00
Authentication code: 1152

How to use temporary-path from C# code? (windows)

Post by Ljurka » 2018-07-13T03:08:10-07:00

Hello!

Does anybody knows how to set up temporary-path from C# (not from command line and not from env var)

I have to run my app on server and could not give write access to the default path where magick stores temp files (..\Windows\system32\..)

Thank you

246246
Posts: 157
Joined: 2015-07-06T07:38:22-07:00
Authentication code: 1151

Re: How to use temporary-path from C# code? (windows)

Post by 246246 » 2018-07-13T07:59:58-07:00

Use MagickNET.SetTempDirectory(). See https://github.com/dlemstra/Magick.NET/ ... -directory

Ljurka
Posts: 4
Joined: 2018-07-01T13:53:12-07:00
Authentication code: 1152

Re: How to use temporary-path from C# code? (windows)

Post by Ljurka » 2018-07-16T07:07:37-07:00

Thanks but I could not find example of usage, where should I apply MagickNET.SetTempDirectory("c:/temp")

246246
Posts: 157
Joined: 2015-07-06T07:38:22-07:00
Authentication code: 1151

Re: How to use temporary-path from C# code? (windows)

Post by 246246 » 2018-07-16T07:38:12-07:00

It just call Environment.SetEnv().
https://github.com/dlemstra/Magick.NET/ ... ET.cs#L262
So it should be called at the very first of each process that uses Magick.NET.

Post Reply