Through the application, the archive is downloaded to the site and after that it must be unpacked, but it constantly throws an error that the file already exists in the folder.
if (g.ProgressPercentage == 100) {
if (!File.Exists(Path.GetFullPath(path))) {
try {
ZipFile.ExtractToDirectory(zipDown, Path.GetDirectoryName(path));
} catch (Exception) { throw; }
Variable zipDown = @".\Client.zip"; (downloaded archive)
Path.GetDirectoryName(path) = folder "Client" in root app dir (with downloaded archive)
exception: System.Reflection.TargetInvocationException: "Invocation target threw an exception."
IOException: File "C:\Users\User\source\repos\CLauncher\bin\Debug\Client\Syntware\CefSharp.BrowserSubprocess.Core.dll" already exists.
This exception was originally thrown in this call stack:
System.IO.__Error.WinIOError(int, string)
System.IO.FileStream.Init(string, System.IO.FileMode, System.IO.FileAccess, int, bool, System.IO.FileShare, int, System.IO.FileOptions, Microsoft.Win32.Win32Native.SECURITY_ATTRIBUTES, string, bool, bool, bool)
System.IO.FileStream.FileStream(string, System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare)
System.IO.Compression.ZipFileExtensions.ExtractToFile(System.IO.Compression.ZipArchiveEntry, string, bool)
System.IO.Compression.ZipFileExtensions.ExtractToDirectory(System.IO.Compression.ZipArchive, string)
System.IO.Compression.ZipFile.ExtractToDirectory(string, string, System.Text.Encoding)
System.IO.Compression.ZipFile.ExtractToDirectory(string, string)
CLauncher.Main.UpdateClient.AnonymousMethod__10_0(object, System.Net.DownloadProgressChangedEventArgs) in Main.cs
System.Net.WebClient.OnDownloadProgressChanged(System.Net.DownloadProgressChangedEventArgs)
System.Net.WebClient.ReportDownloadProgressChanged(object)
full code: https://pastebin.com/ZKt2YJf0
Help guys...