MarcinZiabek 3 ani în urmă
părinte
comite
d740d67a64
2 a modificat fișierele cu 6 adăugiri și 3 ștergeri
  1. 5 2
      QuestPDF/Previewer/PreviewerService.cs
  2. 1 1
      QuestPDF/QuestPDF.csproj

+ 5 - 2
QuestPDF/Previewer/PreviewerService.cs

@@ -17,6 +17,9 @@ namespace QuestPDF.Previewer
         private HttpClient HttpClient { get; }
         private HttpClient HttpClient { get; }
         
         
         public  event Action? OnPreviewerStopped;
         public  event Action? OnPreviewerStopped;
+
+        private const int RequiredPreviewerVersionMajor = 2022;
+        private const int RequiredPreviewerVersionMinor = 6;
         
         
         public PreviewerService(int port)
         public PreviewerService(int port)
         {
         {
@@ -94,12 +97,12 @@ namespace QuestPDF.Previewer
 
 
         private void CheckVersionCompatibility(Version version)
         private void CheckVersionCompatibility(Version version)
         {
         {
-            if (version.Major == 2022 && version.Minor == 6)
+            if (version.Major == RequiredPreviewerVersionMajor && version.Minor == RequiredPreviewerVersionMinor)
                 return;
                 return;
             
             
             throw new Exception($"Previewer version is not compatible. Possible solutions: " +
             throw new Exception($"Previewer version is not compatible. Possible solutions: " +
                                 $"1) Update the QuestPDF library to newer version. " +
                                 $"1) Update the QuestPDF library to newer version. " +
-                                $"2) Update the QuestPDF previewer tool using the following command: 'dotnet tool update --global QuestPDF.Previewer --version 2022.5'");
+                                $"2) Update the QuestPDF previewer tool using the following command: 'dotnet tool update --global QuestPDF.Previewer --version {RequiredPreviewerVersionMajor}.{RequiredPreviewerVersionMinor}'");
         }
         }
         
         
         private async Task WaitForConnection()
         private async Task WaitForConnection()

+ 1 - 1
QuestPDF/QuestPDF.csproj

@@ -3,7 +3,7 @@
         <Authors>MarcinZiabek</Authors>
         <Authors>MarcinZiabek</Authors>
         <Company>CodeFlint</Company>
         <Company>CodeFlint</Company>
         <PackageId>QuestPDF</PackageId>
         <PackageId>QuestPDF</PackageId>
-        <Version>2022.6.0</Version>
+        <Version>2022.6.1</Version>
         <PackageDescription>QuestPDF is an open-source, modern and battle-tested library that can help you with generating PDF documents by offering friendly, discoverable and predictable C# fluent API.</PackageDescription>
         <PackageDescription>QuestPDF is an open-source, modern and battle-tested library that can help you with generating PDF documents by offering friendly, discoverable and predictable C# fluent API.</PackageDescription>
         <PackageReleaseNotes>$([System.IO.File]::ReadAllText("$(MSBuildProjectDirectory)/Resources/ReleaseNotes.txt"))</PackageReleaseNotes>
         <PackageReleaseNotes>$([System.IO.File]::ReadAllText("$(MSBuildProjectDirectory)/Resources/ReleaseNotes.txt"))</PackageReleaseNotes>
         <LangVersion>9</LangVersion>
         <LangVersion>9</LangVersion>