ZipFile.ExtractToDirectory

Hey, Ive been trying to get ZipFile.ExtractToDirectory to work, but it keeps thrwoing an error. Heres the code

ZipFile.ExtractToDirectory("C:\\Users\\Myname\\Documents\\GitHub\\gamePatcher\\patcher\\patcher\\bin\\Debug\\gameDir.zip", "C:\\Users\\Myname\\Desktop\\gameDir"); 

I have the .zip present and the folder that it needs to extract to gets created properly, but then it throws an error and says:
An unhandled exception of type 'System.IO.IOException' occurred in System.IO.Compression.FileSystem.dll

Additional information: Extracting Zip entry would have resulted in a file outside the specified destination directory. 

Any help would be great!

by banana_shavings via /r/csharp

Leave a Reply