From c36c5140f4c5cd444a1c3f7eebc47795bc5a43b9 Mon Sep 17 00:00:00 2001 From: Kees van Spelde Date: Sat, 22 Jun 2024 11:27:33 +0200 Subject: [PATCH] Upgraded MsgViewer to .net 6 --- MsgReader.sln | 2 +- MsgReaderCore/MsgReader.csproj | 2 +- MsgReaderCore/MsgReader.csproj.DotSettings | 2 +- MsgReaderCore/Reader.cs | 2 - MsgViewer/Helpers/WindowPlacement.cs | 2 +- MsgViewer/MsgViewer.csproj | 113 ++------------------- MsgViewer/MsgViewer.csproj.DotSettings | 2 +- MsgViewer/Properties/AssemblyInfo.cs | 35 ------- MsgViewer/ViewerForm.cs | 2 +- 9 files changed, 13 insertions(+), 149 deletions(-) delete mode 100644 MsgViewer/Properties/AssemblyInfo.cs diff --git a/MsgReader.sln b/MsgReader.sln index 265f78f4..d26fa29f 100644 --- a/MsgReader.sln +++ b/MsgReader.sln @@ -24,7 +24,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_documentation", "_document _documentation_\[MS-OXRTFEX].pdf = _documentation_\[MS-OXRTFEX].pdf EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MsgViewer", "MsgViewer\MsgViewer.csproj", "{0EAB7816-7958-41D7-8713-E410C5403A6C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MsgViewer", "MsgViewer\MsgViewer.csproj", "{0EAB7816-7958-41D7-8713-E410C5403A6C}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/MsgReaderCore/MsgReader.csproj b/MsgReaderCore/MsgReader.csproj index c71fdbaf..87a3b8e5 100644 --- a/MsgReaderCore/MsgReader.csproj +++ b/MsgReaderCore/MsgReader.csproj @@ -14,7 +14,7 @@ https://github.com/Sicos1977/MSGReader GitHub - 10.0 + latest Outlook MSG Signed EML Contact Appointment Task Read Outlook MSG and EML files without using Outlook. The MSGReader supports MSG E-Mail (also signed), Contact, Appointment, Task, Sticky notes and Contact files. The EML reader supports MIME 1.0 encoded files. diff --git a/MsgReaderCore/MsgReader.csproj.DotSettings b/MsgReaderCore/MsgReader.csproj.DotSettings index 4887f947..195c4606 100644 --- a/MsgReaderCore/MsgReader.csproj.DotSettings +++ b/MsgReaderCore/MsgReader.csproj.DotSettings @@ -1,2 +1,2 @@  - CSharp100 \ No newline at end of file + Latest \ No newline at end of file diff --git a/MsgReaderCore/Reader.cs b/MsgReaderCore/Reader.cs index ba2e6468..96c01486 100644 --- a/MsgReaderCore/Reader.cs +++ b/MsgReaderCore/Reader.cs @@ -418,8 +418,6 @@ public string[] ExtractToFolder( using (var stream = File.Open(inputFile, FileMode.Open, FileAccess.Read, FileShare.Read)) using (var message = new Storage.Message(stream)) { - var id = message.MessageLocalId; - messageType ??= message.Type; Logger.WriteToLog($"MSG file has the type '{messageType}'"); diff --git a/MsgViewer/Helpers/WindowPlacement.cs b/MsgViewer/Helpers/WindowPlacement.cs index f6d78d3c..89021d88 100644 --- a/MsgViewer/Helpers/WindowPlacement.cs +++ b/MsgViewer/Helpers/WindowPlacement.cs @@ -18,7 +18,7 @@ public static class WindowPlacement private const int SW_SHOWNORMAL = 1; private const int SW_SHOWMINIMIZED = 2; private static readonly Encoding Encoding = new UTF8Encoding(); - private static readonly XmlSerializer Serializer = new XmlSerializer(typeof(NativeMethods.WINDOWPLACEMENT)); + private static readonly XmlSerializer Serializer = new(typeof(NativeMethods.WINDOWPLACEMENT)); #endregion #region SetPlacement diff --git a/MsgViewer/MsgViewer.csproj b/MsgViewer/MsgViewer.csproj index c6bb9045..1e2fda9d 100644 --- a/MsgViewer/MsgViewer.csproj +++ b/MsgViewer/MsgViewer.csproj @@ -1,126 +1,27 @@ - - + - Debug + net6.0-windows x86 - 8.0.30703 - 2.0 - {0EAB7816-7958-41D7-8713-E410C5403A6C} WinExe - Properties - MsgViewer - MsgViewer - v4.6.2 - - - 512 SAK SAK SAK SAK - true - PackageReference + latest + false + true + true - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 false - false - - - AnyCPU - pdbonly - true - bin\release\ - TRACE - prompt - 4 - false Wwalczyszyn-Android-Style-Mail.ico - - AnyCPU - bin\Debug\ - false - - - AnyCPU - bin\Release\ - false - - - - - - - - - - - - - - Form - - - ViewerForm.cs - - - - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - True - - - ViewerForm.cs - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - - - - - - {7627e4f4-44fe-465d-b89d-a4bb669b12d7} - MsgReader - + - - \ No newline at end of file diff --git a/MsgViewer/MsgViewer.csproj.DotSettings b/MsgViewer/MsgViewer.csproj.DotSettings index 6162834d..195c4606 100644 --- a/MsgViewer/MsgViewer.csproj.DotSettings +++ b/MsgViewer/MsgViewer.csproj.DotSettings @@ -1,2 +1,2 @@  - CSharp90 \ No newline at end of file + Latest \ No newline at end of file diff --git a/MsgViewer/Properties/AssemblyInfo.cs b/MsgViewer/Properties/AssemblyInfo.cs deleted file mode 100644 index 5bf3e0e0..00000000 --- a/MsgViewer/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("MsgViewer")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("MsgViewer")] -[assembly: AssemblyCopyright("Copyright © 2013 - 2019 Kees van Spelde")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("d0039ed7-030f-4186-9c6f-b4c9a7450732")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("3.6.0.0")] -[assembly: AssemblyFileVersion("3.6.0.0")] diff --git a/MsgViewer/ViewerForm.cs b/MsgViewer/ViewerForm.cs index f1c9f3a4..fb17ac97 100644 --- a/MsgViewer/ViewerForm.cs +++ b/MsgViewer/ViewerForm.cs @@ -42,7 +42,7 @@ public partial class ViewerForm : Form /// /// Used to track all the created temporary folders /// - readonly List _tempFolders = new List(); + readonly List _tempFolders = []; #endregion #region Form events