0
我正在使用Squirrel.Windows作为我的应用程序的更新框架,并且我从1.4.4升级到最新版本1.5.2,并且通过NuGet升级后,UpdateManager类变得无法访问,原因是这是保护级别。由于保护级别而无法访问公共类
我创建了一个示例项目,并通过NuGet导入了Squirrel.Windows nuget包,并且我能够实例化UpdateManager类的一个实例而没有问题。 我试着清理出与Squirrel.Windows项目相关的所有NuGet包,并清理了与它相关的csproj中剩下的任何信息,再次导入包后,我仍然无法访问该类。
namespace Our.Core
{
public class Launcher
{
public static void Main(string[] args)
{
new Launcher(args);
}
public async Task<bool> TryUpdate(string[] args)
{
try
{
using (var mgr = new UpdateManager(UpdatePath, null, null, null))
{
Log.Information("Checking for updates");
var updateInfo = await mgr.CheckForUpdate();
if (updateInfo.ReleasesToApply.Any())
{
Log.Information("Downloading updates");
await mgr.DownloadReleases(updateInfo.ReleasesToApply);
Log.Information("Applying updates");
await mgr.ApplyReleases(updateInfo);
return true;
}
Log.Information("No updates found.");
return false;
}
}
catch (Exception e)
{
Log.Error(e, "Error while updating");
return false;
}
}
}
}