2017-03-09 6 views
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; 
      } 
     } 
    } 
} 

답변

0

라이브러리를 업그레이드 한 후 프로젝트의 참조에 특정 버전 속성이 false로 토글되었다는 것이 문제가되었습니다. 이로 인해 Visual Studio에서 라이브러리의 올바른 버전을 올바르게 참조 할 수 없었습니다.

이야기의 도덕적 인면, 버전을 확인하고 특정 버전을 사용해야하는 경우 특정 버전 확인이 사실인지 확인하십시오!