I'm not sure why I am getting this error.I am trying to build this on Visual Studio.I am new but i need to build this code.
There are my errors and code :
(30,19): error CS1003: Syntax error, '(' expected
(30,88): error CS1026: ) expected
(31,19): error CS1003: Syntax error, '(' expected
(31,51): error CS1026: ) expected
(36,23): error CS1003: Syntax error, '(' expected
(36,63): error CS1026: ) expected
(37,23): error CS1003: Syntax error, '(' expected
(37,156): error CS1026: ) expected
namespace MelonLoader.AssemblyGenerator
{
public static class DownloaderAndUnpacker
{
public static void Run(string url, string targetVersion, string currentVersion, string destinationFolder, string tempFile)
{
if (targetVersion == currentVersion)
{
Logger.Log($"{destinationFolder} already contains required version, skipping download");
return;
}
Logger.Log($"Cleaning {destinationFolder}");
foreach (var entry in Directory.EnumerateFileSystemEntries(destinationFolder))
{
if (Directory.Exists(entry))
Directory.Delete(entry, true);
else
File.Delete(entry);
}
Logger.Log($"Downloading {url} to {tempFile}");
Program.webClient.DownloadFile(url, tempFile);
Logger.Log($"Extracting {tempFile} to {destinationFolder}");
/*line 30*/ using var stream = new FileStream(tempFile, FileMode.Open, FileAccess.Read);
using var zip = new ZipArchive(stream);
foreach (var zipArchiveEntry in zip.Entries)
{
Logger.Log($"Extracting {zipArchiveEntry.FullName}");
using var entryStream = zipArchiveEntry.Open();
using var targetStream = new FileStream(Path.Combine(destinationFolder, zipArchiveEntry.FullName), FileMode.OpenOrCreate, FileAccess.Write);
entryStream.CopyTo(targetStream);
}
}
}
}