From c2fbecc2eb39bb197c1cb6f1dd3e5bc5a4da642d Mon Sep 17 00:00:00 2001 From: Vladimir Litvinchik Date: Thu, 23 Dec 2021 11:48:23 +0200 Subject: [PATCH 1/2] Update GroupDocs.Viewer to 21.12 --- .../src/GroupDocs.Viewer.AspNetCore.csproj | 4 +- .../src/GroupDocs.Viewer.AspNetCore.sln | 25 ++ Demos/MVC/src/GroupDocs.Viewer.MVC.csproj | 4 +- Demos/MVC/src/Web.config | 8 +- Demos/MVC/src/packages.config | 2 +- .../GroupDocs.Viewer.MVC.Test.csproj | 5 +- .../GroupDocs.Viewer.MVC.Test/app.config | 281 +++++++++--------- .../GroupDocs.Viewer.MVC.Test/packages.config | 44 +-- Demos/WPF/src/GroupDocs.Viewer.WPF.csproj | 2 +- .../src/GroupDocs.Viewer.WebForms.csproj | 4 +- Demos/WebForms/src/Web.config | 8 +- Demos/WebForms/src/packages.config | 2 +- .../src/GroupDocs.Viewer.WinForms/App.config | 148 ++++----- .../GroupDocs.Viewer.WinForms.csproj | 208 ++++++------- .../GroupDocs.Viewer.WinForms/packages.config | 6 +- ...oupDocs.Viewer.Examples.CSharp.Core.csproj | 2 +- .../App.config | 8 +- ...cs.Viewer.Examples.CSharp.Framework.csproj | 4 +- .../packages.config | 2 +- 19 files changed, 399 insertions(+), 368 deletions(-) create mode 100644 Demos/ASP.NET Core/src/GroupDocs.Viewer.AspNetCore.sln diff --git a/Demos/ASP.NET Core/src/GroupDocs.Viewer.AspNetCore.csproj b/Demos/ASP.NET Core/src/GroupDocs.Viewer.AspNetCore.csproj index 6f2b9250d..d46d09d9c 100644 --- a/Demos/ASP.NET Core/src/GroupDocs.Viewer.AspNetCore.csproj +++ b/Demos/ASP.NET Core/src/GroupDocs.Viewer.AspNetCore.csproj @@ -5,10 +5,10 @@ - + - + diff --git a/Demos/ASP.NET Core/src/GroupDocs.Viewer.AspNetCore.sln b/Demos/ASP.NET Core/src/GroupDocs.Viewer.AspNetCore.sln new file mode 100644 index 000000000..cacab5fca --- /dev/null +++ b/Demos/ASP.NET Core/src/GroupDocs.Viewer.AspNetCore.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31727.386 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GroupDocs.Viewer.AspNetCore", "GroupDocs.Viewer.AspNetCore.csproj", "{C768826C-6841-4F71-8488-804CEC2FFC67}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C768826C-6841-4F71-8488-804CEC2FFC67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C768826C-6841-4F71-8488-804CEC2FFC67}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C768826C-6841-4F71-8488-804CEC2FFC67}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C768826C-6841-4F71-8488-804CEC2FFC67}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A0248D4A-92EB-4E61-9FDA-4F68D6F19336} + EndGlobalSection +EndGlobal diff --git a/Demos/MVC/src/GroupDocs.Viewer.MVC.csproj b/Demos/MVC/src/GroupDocs.Viewer.MVC.csproj index 60b145b71..071f4222d 100644 --- a/Demos/MVC/src/GroupDocs.Viewer.MVC.csproj +++ b/Demos/MVC/src/GroupDocs.Viewer.MVC.csproj @@ -45,8 +45,8 @@ 4 - - ..\packages\GroupDocs.Viewer.21.11.0\lib\net40\GroupDocs.Viewer.dll + + ..\packages\GroupDocs.Viewer.21.12.0\lib\net40\GroupDocs.Viewer.dll ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll diff --git a/Demos/MVC/src/Web.config b/Demos/MVC/src/Web.config index cd27eefa8..eab394604 100644 --- a/Demos/MVC/src/Web.config +++ b/Demos/MVC/src/Web.config @@ -110,7 +110,7 @@ - + @@ -125,7 +125,7 @@ - + @@ -150,7 +150,7 @@ - + @@ -160,7 +160,7 @@ - + diff --git a/Demos/MVC/src/packages.config b/Demos/MVC/src/packages.config index 185d66a81..26e4a803d 100644 --- a/Demos/MVC/src/packages.config +++ b/Demos/MVC/src/packages.config @@ -1,7 +1,7 @@  - + diff --git a/Demos/MVC/tests/GroupDocs.Viewer.MVC.Test/GroupDocs.Viewer.MVC.Test.csproj b/Demos/MVC/tests/GroupDocs.Viewer.MVC.Test/GroupDocs.Viewer.MVC.Test.csproj index 30d2bb272..325a3b6dd 100644 --- a/Demos/MVC/tests/GroupDocs.Viewer.MVC.Test/GroupDocs.Viewer.MVC.Test.csproj +++ b/Demos/MVC/tests/GroupDocs.Viewer.MVC.Test/GroupDocs.Viewer.MVC.Test.csproj @@ -42,8 +42,9 @@ ..\..\packages\Castle.Core.4.3.1\lib\net45\Castle.Core.dll - - ..\..\packages\GroupDocs.Viewer.21.10.0\lib\net40\GroupDocs.Viewer.dll + + ..\..\packages\GroupDocs.Viewer.21.12.0\lib\net40\GroupDocs.Viewer.dll + True ..\..\packages\Huygens.1.4.5\lib\net46\Huygens.dll diff --git a/Demos/MVC/tests/GroupDocs.Viewer.MVC.Test/app.config b/Demos/MVC/tests/GroupDocs.Viewer.MVC.Test/app.config index b90d690f3..2581202a0 100644 --- a/Demos/MVC/tests/GroupDocs.Viewer.MVC.Test/app.config +++ b/Demos/MVC/tests/GroupDocs.Viewer.MVC.Test/app.config @@ -1,139 +1,144 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Demos/MVC/tests/GroupDocs.Viewer.MVC.Test/packages.config b/Demos/MVC/tests/GroupDocs.Viewer.MVC.Test/packages.config index 180f910aa..80f3132cd 100644 --- a/Demos/MVC/tests/GroupDocs.Viewer.MVC.Test/packages.config +++ b/Demos/MVC/tests/GroupDocs.Viewer.MVC.Test/packages.config @@ -1,23 +1,23 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Demos/WPF/src/GroupDocs.Viewer.WPF.csproj b/Demos/WPF/src/GroupDocs.Viewer.WPF.csproj index d7ee64d79..57899fd52 100644 --- a/Demos/WPF/src/GroupDocs.Viewer.WPF.csproj +++ b/Demos/WPF/src/GroupDocs.Viewer.WPF.csproj @@ -41,7 +41,7 @@ - + \ No newline at end of file diff --git a/Demos/WebForms/src/GroupDocs.Viewer.WebForms.csproj b/Demos/WebForms/src/GroupDocs.Viewer.WebForms.csproj index 144b12d76..6de5de7a1 100644 --- a/Demos/WebForms/src/GroupDocs.Viewer.WebForms.csproj +++ b/Demos/WebForms/src/GroupDocs.Viewer.WebForms.csproj @@ -44,8 +44,8 @@ 4 - - ..\packages\GroupDocs.Viewer.21.11.0\lib\net40\GroupDocs.Viewer.dll + + ..\packages\GroupDocs.Viewer.21.12.0\lib\net40\GroupDocs.Viewer.dll ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll diff --git a/Demos/WebForms/src/Web.config b/Demos/WebForms/src/Web.config index 8bfe6a81f..5369c39e7 100644 --- a/Demos/WebForms/src/Web.config +++ b/Demos/WebForms/src/Web.config @@ -138,7 +138,7 @@ - + @@ -153,7 +153,7 @@ - + @@ -178,7 +178,7 @@ - + @@ -188,7 +188,7 @@ - + diff --git a/Demos/WebForms/src/packages.config b/Demos/WebForms/src/packages.config index f0c9a2b50..897c83c3b 100644 --- a/Demos/WebForms/src/packages.config +++ b/Demos/WebForms/src/packages.config @@ -1,7 +1,7 @@  - + diff --git a/Demos/WinForms/src/GroupDocs.Viewer.WinForms/App.config b/Demos/WinForms/src/GroupDocs.Viewer.WinForms/App.config index 812078329..06fbdbb88 100644 --- a/Demos/WinForms/src/GroupDocs.Viewer.WinForms/App.config +++ b/Demos/WinForms/src/GroupDocs.Viewer.WinForms/App.config @@ -1,75 +1,75 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Demos/WinForms/src/GroupDocs.Viewer.WinForms/GroupDocs.Viewer.WinForms.csproj b/Demos/WinForms/src/GroupDocs.Viewer.WinForms/GroupDocs.Viewer.WinForms.csproj index 868cd6c2c..885f796fb 100644 --- a/Demos/WinForms/src/GroupDocs.Viewer.WinForms/GroupDocs.Viewer.WinForms.csproj +++ b/Demos/WinForms/src/GroupDocs.Viewer.WinForms/GroupDocs.Viewer.WinForms.csproj @@ -1,105 +1,105 @@ - - - - - Debug - AnyCPU - {B57F5DB0-7F9D-4B27-97C4-E60321D7D094} - WinExe - GroupsDocs.Viewer.Forms.UI - GroupsDocs.Viewer.Forms.UI - v4.6.1 - 512 - true - true - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\packages\GroupDocs.Viewer.21.11.0\lib\net40\GroupDocs.Viewer.dll - - - - - - - - - - - - - - - - Form - - - EnterPasswordBox.cs - - - Form - - - MainForm.cs - - - - - - EnterPasswordBox.cs - - - MainForm.cs - - - ResXFileCodeGenerator - Designer - Resources.Designer.cs - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - True - Resources.resx - - - True - Settings.settings - True - - - - - - - - - - - - - + + + + + Debug + AnyCPU + {B57F5DB0-7F9D-4B27-97C4-E60321D7D094} + WinExe + GroupsDocs.Viewer.Forms.UI + GroupsDocs.Viewer.Forms.UI + v4.6.1 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\GroupDocs.Viewer.21.12.0\lib\net40\GroupDocs.Viewer.dll + + + + + + + + + + + + + + + + Form + + + EnterPasswordBox.cs + + + Form + + + MainForm.cs + + + + + + EnterPasswordBox.cs + + + MainForm.cs + + + ResXFileCodeGenerator + Designer + Resources.Designer.cs + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + + + + + + + + + \ No newline at end of file diff --git a/Demos/WinForms/src/GroupDocs.Viewer.WinForms/packages.config b/Demos/WinForms/src/GroupDocs.Viewer.WinForms/packages.config index f24cb0515..fc6c43cea 100644 --- a/Demos/WinForms/src/GroupDocs.Viewer.WinForms/packages.config +++ b/Demos/WinForms/src/GroupDocs.Viewer.WinForms/packages.config @@ -1,4 +1,4 @@ - - - + + + \ No newline at end of file diff --git a/Examples/GroupDocs.Viewer.Examples.CSharp.Core/GroupDocs.Viewer.Examples.CSharp.Core.csproj b/Examples/GroupDocs.Viewer.Examples.CSharp.Core/GroupDocs.Viewer.Examples.CSharp.Core.csproj index dd10e1350..7f03a3ab6 100644 --- a/Examples/GroupDocs.Viewer.Examples.CSharp.Core/GroupDocs.Viewer.Examples.CSharp.Core.csproj +++ b/Examples/GroupDocs.Viewer.Examples.CSharp.Core/GroupDocs.Viewer.Examples.CSharp.Core.csproj @@ -8,7 +8,7 @@ - + diff --git a/Examples/GroupDocs.Viewer.Examples.CSharp.Framework/App.config b/Examples/GroupDocs.Viewer.Examples.CSharp.Framework/App.config index 5aa2921ca..85090e0b4 100644 --- a/Examples/GroupDocs.Viewer.Examples.CSharp.Framework/App.config +++ b/Examples/GroupDocs.Viewer.Examples.CSharp.Framework/App.config @@ -40,7 +40,7 @@ - + @@ -55,7 +55,7 @@ - + @@ -80,7 +80,7 @@ - + @@ -90,7 +90,7 @@ - + diff --git a/Examples/GroupDocs.Viewer.Examples.CSharp.Framework/GroupDocs.Viewer.Examples.CSharp.Framework.csproj b/Examples/GroupDocs.Viewer.Examples.CSharp.Framework/GroupDocs.Viewer.Examples.CSharp.Framework.csproj index a05257c77..60af72356 100644 --- a/Examples/GroupDocs.Viewer.Examples.CSharp.Framework/GroupDocs.Viewer.Examples.CSharp.Framework.csproj +++ b/Examples/GroupDocs.Viewer.Examples.CSharp.Framework/GroupDocs.Viewer.Examples.CSharp.Framework.csproj @@ -47,8 +47,8 @@ 4 - - ..\packages\GroupDocs.Viewer.21.11.0\lib\net40\GroupDocs.Viewer.dll + + ..\packages\GroupDocs.Viewer.21.12.0\lib\net40\GroupDocs.Viewer.dll ..\packages\Microsoft.Bcl.AsyncInterfaces.1.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll diff --git a/Examples/GroupDocs.Viewer.Examples.CSharp.Framework/packages.config b/Examples/GroupDocs.Viewer.Examples.CSharp.Framework/packages.config index b94e4abbf..b76ffa88a 100644 --- a/Examples/GroupDocs.Viewer.Examples.CSharp.Framework/packages.config +++ b/Examples/GroupDocs.Viewer.Examples.CSharp.Framework/packages.config @@ -1,6 +1,6 @@  - + From dcb789a811ece25c2f0d9d07bf599d5dfac2984e Mon Sep 17 00:00:00 2001 From: Vladimir Litvinchik Date: Thu, 23 Dec 2021 11:49:40 +0200 Subject: [PATCH 2/2] Run examples in Docker --- Examples/.dockerignore | 25 ++++++++++ .../Dockerfile | 49 +++++++++++++++++++ ...oupDocs.Viewer.Examples.CSharp.Core.csproj | 5 +- .../Properties/launchSettings.json | 10 ++++ .../RunExamples.cs | 1 - .../TestFiles.cs | 15 ++++-- 6 files changed, 100 insertions(+), 5 deletions(-) create mode 100644 Examples/.dockerignore create mode 100644 Examples/GroupDocs.Viewer.Examples.CSharp.Core/Dockerfile create mode 100644 Examples/GroupDocs.Viewer.Examples.CSharp.Core/Properties/launchSettings.json diff --git a/Examples/.dockerignore b/Examples/.dockerignore new file mode 100644 index 000000000..bdca33b44 --- /dev/null +++ b/Examples/.dockerignore @@ -0,0 +1,25 @@ +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/azds.yaml +**/bin +**/charts +**/docker-compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +LICENSE +README.md \ No newline at end of file diff --git a/Examples/GroupDocs.Viewer.Examples.CSharp.Core/Dockerfile b/Examples/GroupDocs.Viewer.Examples.CSharp.Core/Dockerfile new file mode 100644 index 000000000..3fb145c70 --- /dev/null +++ b/Examples/GroupDocs.Viewer.Examples.CSharp.Core/Dockerfile @@ -0,0 +1,49 @@ +# Navigate to 'Examples' folder +# Build container image with `docker build -f "GroupDocs.Viewer.Examples.CSharp.Core\Dockerfile" -t groupdocs-viewer:examples .` +# Run container `docker run -it --rm -v ${pwd}/Output:/app/Output groupdocs-viewer:examples` +# Or run 'Docker' profile in Visual Studio + +FROM mcr.microsoft.com/dotnet/runtime:3.1-bionic AS base +WORKDIR /app + +# begin install libgdiplus and dependencies +RUN apt-get update \ + && apt-get install -y \ + apt-transport-https \ + dirmngr \ + gnupg \ + ca-certificates + +RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF \ + && echo "deb https://download.mono-project.com/repo/ubuntu stable-bionic main" >> /etc/apt/sources.list.d/mono-official-stable.list + +RUN apt-get update \ + && apt-get install -y --allow-unauthenticated \ + libc6-dev \ + libgdiplus \ + libx11-dev + +# begin ttf-mscorefonts-installer +RUN echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" | debconf-set-selections \ + && apt-get update \ + && apt-get install -y \ + libfontconfig1 \ + xfonts-utils \ + ttf-mscorefonts-installer +# end ttf-mscorefonts-installer + +FROM mcr.microsoft.com/dotnet/sdk:3.1-bionic AS build +WORKDIR /src +COPY ["GroupDocs.Viewer.Examples.CSharp.Core/GroupDocs.Viewer.Examples.CSharp.Core.csproj", "GroupDocs.Viewer.Examples.CSharp.Core/"] +RUN dotnet restore "GroupDocs.Viewer.Examples.CSharp.Core/GroupDocs.Viewer.Examples.CSharp.Core.csproj" +COPY . . +WORKDIR "/src/GroupDocs.Viewer.Examples.CSharp.Core" +RUN dotnet build "GroupDocs.Viewer.Examples.CSharp.Core.csproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "GroupDocs.Viewer.Examples.CSharp.Core.csproj" -c Release -o /app/publish + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "GroupDocs.Viewer.Examples.CSharp.Core.dll"] \ No newline at end of file diff --git a/Examples/GroupDocs.Viewer.Examples.CSharp.Core/GroupDocs.Viewer.Examples.CSharp.Core.csproj b/Examples/GroupDocs.Viewer.Examples.CSharp.Core/GroupDocs.Viewer.Examples.CSharp.Core.csproj index 7f03a3ab6..c682900b7 100644 --- a/Examples/GroupDocs.Viewer.Examples.CSharp.Core/GroupDocs.Viewer.Examples.CSharp.Core.csproj +++ b/Examples/GroupDocs.Viewer.Examples.CSharp.Core/GroupDocs.Viewer.Examples.CSharp.Core.csproj @@ -3,12 +3,15 @@ Exe netcoreapp3.1 + Linux + + - + \ No newline at end of file diff --git a/Examples/GroupDocs.Viewer.Examples.CSharp.Core/Properties/launchSettings.json b/Examples/GroupDocs.Viewer.Examples.CSharp.Core/Properties/launchSettings.json new file mode 100644 index 000000000..57ad31b86 --- /dev/null +++ b/Examples/GroupDocs.Viewer.Examples.CSharp.Core/Properties/launchSettings.json @@ -0,0 +1,10 @@ +{ + "profiles": { + "GroupDocs.Viewer.Examples.CSharp.Core": { + "commandName": "Project" + }, + "Docker": { + "commandName": "Docker" + } + } +} \ No newline at end of file diff --git a/Examples/GroupDocs.Viewer.Examples.CSharp.Core/RunExamples.cs b/Examples/GroupDocs.Viewer.Examples.CSharp.Core/RunExamples.cs index 329e4d42f..efdf9b0e6 100644 --- a/Examples/GroupDocs.Viewer.Examples.CSharp.Core/RunExamples.cs +++ b/Examples/GroupDocs.Viewer.Examples.CSharp.Core/RunExamples.cs @@ -237,7 +237,6 @@ static void Main() Console.WriteLine(); Console.WriteLine("All done."); - Console.ReadKey(); } } } diff --git a/Examples/GroupDocs.Viewer.Examples.CSharp/TestFiles.cs b/Examples/GroupDocs.Viewer.Examples.CSharp/TestFiles.cs index 435299c6d..51989f4ad 100644 --- a/Examples/GroupDocs.Viewer.Examples.CSharp/TestFiles.cs +++ b/Examples/GroupDocs.Viewer.Examples.CSharp/TestFiles.cs @@ -1,4 +1,6 @@ -using System.IO; +using System; +using System.IO; +using System.Runtime.InteropServices; namespace GroupDocs.Viewer.Examples.CSharp { @@ -151,7 +153,14 @@ public static class TestFiles public static string SAMPLE_CHM => GetSampleFilePath("sample.chm"); - private static string GetSampleFilePath(string filePath) => - Path.Combine(Utils.SamplesPath, filePath); + private static string GetSampleFilePath(string filePath) + { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + return Path.Combine(Utils.SamplesPath, filePath); + + var assembly = System.Reflection.Assembly.GetEntryAssembly(); + var entryAssemblyDirectory = Path.GetDirectoryName(assembly.Location); + return Path.Combine(entryAssemblyDirectory, Utils.SamplesPath, filePath); + } } } \ No newline at end of file