我使用Squirrel.Windows作为我的应用程序的更新框架,并将其从1.4.4升级到最新版本1.5.2,在通过NuGet进行升级之后,UpdateManager类由于其保护级别而变得不可访问。
我创建了一个示例项目,并通过Squirrel.Windows导入了nuget NuGet包,并且能够实例化UpdateManager类的一个实例,而不存在任何问题。我试着清理了所有与NuGet项目相关的Squirrel.Windows包,并清理了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;
}
}
}
}发布于 2017-03-09 16:12:50
问题是,在升级库之后,项目中的引用将其特定版本属性切换为false。这导致Visual无法正确引用库的正确版本。
故事的寓意,确保检查你的版本,你的特定版本检查是真实的,如果你需要使用一个特定的版本!
https://stackoverflow.com/questions/42700212
复制相似问题