From 2c01fd1096b9804e49a849fe8a3519ecd54859b3 Mon Sep 17 00:00:00 2001 From: EWSoftware Date: Sat, 31 Dec 2022 14:15:16 -0800 Subject: [PATCH] Minor updates for new release --- Deployment/InstallerConfiguration.xml | 4 +- .../SandcastleBuilder/CommonTokens.tokens | 2 +- .../Content/VersionHistory/VersionHistory.aml | 5 + .../Content/VersionHistory/v2022.12.30.0.aml | 88 +++ .../SandcastleBuilder.content | 9 +- .../SandcastleBuilder.shfbproj | 3 +- NuGet/SHFB.NET.nuspec | 2 +- NuGet/SHFB.nuspec | 2 +- .../.NET/.NETCoreStandardNet50Plus.reflection | 629 +++++++++--------- .../Targets/XmlTargetDictionaryUtilities.cs | 4 +- SHFB/Source/MRefBuilder/MRefBuilder.cs | 38 +- .../ReflectionDataManager/BuildProcess.cs | 28 +- .../BuildReflectionDataDlg.xaml.cs | 7 +- .../BuildEngine/SubstitutionTagReplacement.cs | 2 +- .../Properties/AssemblyInfoShared.cs | 8 +- .../SandcastleBuilderUtils.csproj | 2 +- .../SandcastleCore/GlobalSuppressions.cs | 1 + .../Properties/AssemblyInfoShared.cs | 8 +- .../Reflection/AssemblyLocation.cs | 45 +- .../Reflection/ReflectionDataSet.cs | 23 +- .../SandcastleCore/SandcastleCore.csproj | 2 +- SHFB/Source/Setup/DeploymentFiles.wxs | 80 +++ .../BuildComponentCS/BuildComponent.csproj | 2 +- .../BuildComponentVB/BuildComponent.vbproj | 2 +- .../ConfigEditorCS/ConfigEditor.csproj | 4 +- .../ConfigEditorVB/ConfigEditor.vbproj | 4 +- .../Templates/Projects/PlugInCS/PlugIn.csproj | 4 +- .../Templates/Projects/PlugInVB/PlugIn.vbproj | 4 +- .../PresentationStyle.csproj | 2 +- .../SyntaxGeneratorCS/SyntaxGenerator.csproj | 2 +- .../SyntaxGeneratorVB/SyntaxGenerator.vbproj | 2 +- .../VSIX_VS2017/source.extension.vsixmanifest | 2 +- .../VSIX_VS2022/source.extension.vsixmanifest | 2 +- 33 files changed, 640 insertions(+), 382 deletions(-) create mode 100644 Documentation/SandcastleBuilder/Content/VersionHistory/v2022.12.30.0.aml diff --git a/Deployment/InstallerConfiguration.xml b/Deployment/InstallerConfiguration.xml index 3ee5e28f..a00ffbff 100644 --- a/Deployment/InstallerConfiguration.xml +++ b/Deployment/InstallerConfiguration.xml @@ -1,7 +1,7 @@  - + @@ -13,7 +13,7 @@ - diff --git a/Documentation/SandcastleBuilder/CommonTokens.tokens b/Documentation/SandcastleBuilder/CommonTokens.tokens index 13a4582d..48f22796 100644 --- a/Documentation/SandcastleBuilder/CommonTokens.tokens +++ b/Documentation/SandcastleBuilder/CommonTokens.tokens @@ -6,6 +6,6 @@ https://GitHub.com/EWSoftware/SHFB _blank - v2022.10.15.0 + v2022.12.30.0 Visual Studio 2017 \ No newline at end of file diff --git a/Documentation/SandcastleBuilder/Content/VersionHistory/VersionHistory.aml b/Documentation/SandcastleBuilder/Content/VersionHistory/VersionHistory.aml index b6bb7c3d..ee8933c1 100644 --- a/Documentation/SandcastleBuilder/Content/VersionHistory/VersionHistory.aml +++ b/Documentation/SandcastleBuilder/Content/VersionHistory/VersionHistory.aml @@ -20,6 +20,11 @@ updating third-party components, plug-ins, presentation styles, and syntax gener version of the help file builder. + + + + + diff --git a/Documentation/SandcastleBuilder/Content/VersionHistory/v2022.12.30.0.aml b/Documentation/SandcastleBuilder/Content/VersionHistory/v2022.12.30.0.aml new file mode 100644 index 00000000..333168f2 --- /dev/null +++ b/Documentation/SandcastleBuilder/Content/VersionHistory/v2022.12.30.0.aml @@ -0,0 +1,88 @@ + + + + + Release notes for version 2022.12.30.0. See the prior version release notes for information on the +breaking changes made to the presentation styles implementation. + + +
+ Sandcastle Tools + + + + Fixed BuildAssembler so that it sets the locale in the topic transformation to the selected +project's language. + + + + Fixed the spelling of the PresentationStyleSettings.TopicTransformation +property name. Third-party components will need to be rebuilt against the latest version of the NuGet packages. + + + + Updated the .NET Core/.NET Standard/.NET 5.0+ reflection data set to include .NET 7.0 +assembly information. + + + + Fixed framework comments inclusion so that if a target framework is not present (.NET 5.0 or +later), it defaults to using the comments from the latest version that is available. + + + +
+ +
+ Presentation Styles + + + + Fixed the section element handler so that it will render subsections +even when the content element is missing or empty. + + + + + +
+ +
+ Sandcastle Help File Builder + + + + + Updated the package reference resolver to pick the most appropriate target and framework assets +based on the specified target framework rather than just picking the first target asset. + + + + Fixed handling of the TargetFramework property in documentation source +projects if it is blank. + + + + Added Tools\HelpLibraryManagerLauncher.exe to the help file builder NuGet +package. + + + + Changed the help file builder NuGet package build properties file to use +BuildingInsideVisualStudio instead of an empty SHFBROOT value +to determine when to define SHFBROOT for command line builds. Visual Studio and the +standalone GUI will continue to use the installed version of the help file builder tools when building projects. +Command line builds will use whatever version of the help file builder NuGet package is included in the project +regardless of any locally installed version of the tools. + + + + +
+ + + + + +
+
diff --git a/Documentation/SandcastleBuilder/SandcastleBuilder.content b/Documentation/SandcastleBuilder/SandcastleBuilder.content index 1286175c..57bf341d 100644 --- a/Documentation/SandcastleBuilder/SandcastleBuilder.content +++ b/Documentation/SandcastleBuilder/SandcastleBuilder.content @@ -1364,12 +1364,17 @@ - + - + + + + + + diff --git a/Documentation/SandcastleBuilder/SandcastleBuilder.shfbproj b/Documentation/SandcastleBuilder/SandcastleBuilder.shfbproj index 6907eaf8..0b0e7267 100644 --- a/Documentation/SandcastleBuilder/SandcastleBuilder.shfbproj +++ b/Documentation/SandcastleBuilder/SandcastleBuilder.shfbproj @@ -35,7 +35,7 @@ Eric%40EWoodruff.us Default2022 Standard - 2022.10.15.0 + 2022.12.30.0 @@ -401,6 +401,7 @@ + diff --git a/NuGet/SHFB.NET.nuspec b/NuGet/SHFB.NET.nuspec index 8242ca2b..df5bddb5 100644 --- a/NuGet/SHFB.NET.nuspec +++ b/NuGet/SHFB.NET.nuspec @@ -2,7 +2,7 @@ EWSoftware.SHFB.NET - 5.0.0.1 + 7.0.0.0 Sandcastle Help File Builder .NET Core/.NET Standard/.NET 5.0+ Reflection Data Set Eric Woodruff Eric Woodruff diff --git a/NuGet/SHFB.nuspec b/NuGet/SHFB.nuspec index dcf76c89..9cf66931 100644 --- a/NuGet/SHFB.nuspec +++ b/NuGet/SHFB.nuspec @@ -2,7 +2,7 @@ EWSoftware.SHFB - 2022.10.15.1 + 2022.12.30.0 Sandcastle Help File Builder Eric Woodruff Eric Woodruff diff --git a/SHFB/Deploy/Data/.NET/.NETCoreStandardNet50Plus.reflection b/SHFB/Deploy/Data/.NET/.NETCoreStandardNet50Plus.reflection index cdc12a3e..8be3f878 100644 --- a/SHFB/Deploy/Data/.NET/.NETCoreStandardNet50Plus.reflection +++ b/SHFB/Deploy/Data/.NET/.NETCoreStandardNet50Plus.reflection @@ -2,347 +2,354 @@ Reflection data for .NET Core, .NET Standard, and .NET 5.0 or later. - - + + - - + + + - - - - - - - - - + + + + + + + + + - - - + + + - + - + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - + - + - - - - - + + + + + - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SHFB/Source/BuildAssembler/BuildComponents/Targets/XmlTargetDictionaryUtilities.cs b/SHFB/Source/BuildAssembler/BuildComponents/Targets/XmlTargetDictionaryUtilities.cs index 3b93edb5..211c7530 100644 --- a/SHFB/Source/BuildAssembler/BuildComponents/Targets/XmlTargetDictionaryUtilities.cs +++ b/SHFB/Source/BuildAssembler/BuildComponents/Targets/XmlTargetDictionaryUtilities.cs @@ -128,9 +128,9 @@ public static Target CreateTarget(XPathNavigator topic) target.File = (string)topic.Evaluate(topicFileExpression); + // Reflection data sets won't have a filename so just use the ID as the distinct name if(String.IsNullOrEmpty(target.File)) - throw new XmlSchemaValidationException(String.Format(CultureInfo.InvariantCulture, - "The target file '{0}' is not valid (no target file specified).", topic.BaseURI)); + target.File = target.Id; return target; } diff --git a/SHFB/Source/MRefBuilder/MRefBuilder.cs b/SHFB/Source/MRefBuilder/MRefBuilder.cs index 0e4251d8..11281b43 100644 --- a/SHFB/Source/MRefBuilder/MRefBuilder.cs +++ b/SHFB/Source/MRefBuilder/MRefBuilder.cs @@ -2,7 +2,7 @@ // System : Sandcastle MRefBuilder Tool // File : MRefBuilder.cs // Author : Eric Woodruff (Eric@EWoodruff.us) -// Updated : 08/31/2021 +// Updated : 12/30/2022 // // This file contains the class used to make MRefBuilder callable from MSBuild projects. // @@ -43,7 +43,9 @@ public class MRefBuilder : Task, ICancelableTask //===================================================================== private ManagedReflectionWriter apiVisitor; - +#if DEBUG + private bool waitCancelled; +#endif #endregion #region Task properties @@ -79,6 +81,12 @@ public class MRefBuilder : Task, ICancelableTask /// References are optional public ITaskItem[] References { get; set; } +#if DEBUG + /// + /// This is used to indicate whether or not to wait for the debugger to attach to the process + /// + public bool WaitForDebugger { get; set; } +#endif #endregion #region ICancelableTask Members @@ -92,6 +100,9 @@ public void Cancel() { if(apiVisitor != null) apiVisitor.Canceled = true; +#if DEBUG + waitCancelled = true; +#endif } #endregion @@ -106,14 +117,28 @@ public override bool Execute() { string currentDirectory = null; bool success = false; +#if DEBUG + if(this.WaitForDebugger) + { + while(!Debugger.IsAttached && !waitCancelled) + { + this.Log.LogMessage("DEBUG MODE: Waiting for debugger to attach"); + System.Threading.Thread.Sleep(1000); + } + + if(waitCancelled) + return false; + Debugger.Break(); + } +#endif Assembly application = Assembly.GetCallingAssembly(); System.Reflection.AssemblyName applicationData = application.GetName(); FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(application.Location); this.Log.LogMessage("{0} (v{1})", applicationData.Name, fvi.ProductVersion); - object[] copyrightAttributes = application.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), true); + var copyrightAttributes = application.GetCustomAttributes(); foreach(AssemblyCopyrightAttribute copyrightAttribute in copyrightAttributes) this.Log.LogMessage(copyrightAttribute.Copyright); @@ -592,11 +617,8 @@ public bool GenerateReflectionInformation() } finally { - if(apiVisitor != null) - apiVisitor.Dispose(); - - if(output != null) - output.Close(); + apiVisitor?.Dispose(); + output?.Close(); } return apiVisitor != null && !apiVisitor.Canceled; diff --git a/SHFB/Source/ReflectionDataManager/BuildProcess.cs b/SHFB/Source/ReflectionDataManager/BuildProcess.cs index c42e12c0..f30425a3 100644 --- a/SHFB/Source/ReflectionDataManager/BuildProcess.cs +++ b/SHFB/Source/ReflectionDataManager/BuildProcess.cs @@ -2,8 +2,8 @@ // System : Sandcastle Reflection Data Manager // File : BuildProcess.cs // Author : Eric Woodruff (Eric@EWoodruff.us) -// Updated : 06/17/2021 -// Note : Copyright 2015-2021, Eric Woodruff, All rights reserved +// Updated : 12/30/2022 +// Note : Copyright 2015-2022, Eric Woodruff, All rights reserved // // This file contains the class used to build the reflection data // @@ -197,22 +197,19 @@ public void Build() string targetPath = Path.GetDirectoryName(dataSet.Filename); - if(this.ProgressProvider != null) - this.ProgressProvider.Report(String.Format(CultureInfo.InvariantCulture, - "Clearing reflection data files from {0}...", targetPath)); + this.ProgressProvider?.Report(String.Format(CultureInfo.InvariantCulture, + "Clearing reflection data files from {0}...", targetPath)); foreach(string file in Directory.EnumerateFiles(targetPath, "*.xml")) File.Delete(file); - if(this.ProgressProvider != null) - this.ProgressProvider.Report(String.Format(CultureInfo.InvariantCulture, - "Copying new reflection data files to {0}...", targetPath)); + this.ProgressProvider?.Report(String.Format(CultureInfo.InvariantCulture, + "Copying new reflection data files to {0}...", targetPath)); foreach(string file in Directory.EnumerateFiles(Path.Combine(workingFolder, "Segregated"))) File.Copy(file, Path.Combine(targetPath, Path.GetFileName(file))); - if(this.ProgressProvider != null) - this.ProgressProvider.Report("\r\nBuild completed successfully"); + this.ProgressProvider?.Report("\r\nBuild completed successfully"); } /// @@ -229,9 +226,8 @@ private void Run(string processFilename, string targetFile, string arguments) if(processFilename == null) throw new ArgumentNullException(nameof(processFilename)); - if(this.ProgressProvider != null) - this.ProgressProvider.Report(String.Format(CultureInfo.InvariantCulture, "[{0}{1}]", processFilename, - !String.IsNullOrWhiteSpace(targetFile) ? " - " + targetFile : String.Empty)); + this.ProgressProvider?.Report(String.Format(CultureInfo.InvariantCulture, "[{0}{1}]", processFilename, + !String.IsNullOrWhiteSpace(targetFile) ? " - " + targetFile : String.Empty)); if(arguments == null) arguments = String.Empty; @@ -305,8 +301,7 @@ private void Run(string processFilename, string targetFile, string arguments) } finally { - if(currentProcess != null) - currentProcess.Dispose(); + currentProcess?.Dispose(); } } @@ -350,8 +345,7 @@ private void ReadOutputStream(StreamReader stream) if(reErrorCheck.IsMatch(line)) errorDetected = true; - if(this.ProgressProvider != null) - this.ProgressProvider.Report(line); + this.ProgressProvider?.Report(line); } } while(line != null); diff --git a/SHFB/Source/ReflectionDataManager/BuildReflectionDataDlg.xaml.cs b/SHFB/Source/ReflectionDataManager/BuildReflectionDataDlg.xaml.cs index 19c6cdbb..2f96c9fe 100644 --- a/SHFB/Source/ReflectionDataManager/BuildReflectionDataDlg.xaml.cs +++ b/SHFB/Source/ReflectionDataManager/BuildReflectionDataDlg.xaml.cs @@ -2,8 +2,8 @@ // System : Sandcastle Reflection Data Manager // File : BuildReflectionDataDlg.cs // Author : Eric Woodruff (Eric@EWoodruff.us) -// Updated : 04/10/2021 -// Note : Copyright 2015-2021, Eric Woodruff, All rights reserved +// Updated : 12/30/2022 +// Note : Copyright 2015-2022, Eric Woodruff, All rights reserved // // This file contains the window class that is used to manage the build settings and build the reflection data // @@ -88,8 +88,7 @@ private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs if(MessageBox.Show("A build is currently taking place. Do you want to abort it and exit?", "Reflection Data Manager", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes) { - if(cancellationTokenSource != null) - cancellationTokenSource.Cancel(); + cancellationTokenSource?.Cancel(); } e.Cancel = true; diff --git a/SHFB/Source/SandcastleBuilderUtils/BuildEngine/SubstitutionTagReplacement.cs b/SHFB/Source/SandcastleBuilderUtils/BuildEngine/SubstitutionTagReplacement.cs index b5d32d5c..e88e078f 100644 --- a/SHFB/Source/SandcastleBuilderUtils/BuildEngine/SubstitutionTagReplacement.cs +++ b/SHFB/Source/SandcastleBuilderUtils/BuildEngine/SubstitutionTagReplacement.cs @@ -496,7 +496,7 @@ private string HRefFormat() [SubstitutionTag] private string TargetFrameworkIdentifier() { - // If the reflection data is for .NETStandard or .NET 5.0 use .NET Framework use v4.8 + // If the reflection data is for .NETStandard or .NET 5.0 use .NET Framework if(currentBuild.FrameworkReflectionData.Platform == PlatformType.DotNet || currentBuild.FrameworkReflectionData.Platform == PlatformType.DotNetStandard) { diff --git a/SHFB/Source/SandcastleBuilderUtils/Properties/AssemblyInfoShared.cs b/SHFB/Source/SandcastleBuilderUtils/Properties/AssemblyInfoShared.cs index 800b043e..15741170 100644 --- a/SHFB/Source/SandcastleBuilderUtils/Properties/AssemblyInfoShared.cs +++ b/SHFB/Source/SandcastleBuilderUtils/Properties/AssemblyInfoShared.cs @@ -2,7 +2,7 @@ // System : Sandcastle Help File Builder // File : AssemblyInfoShared.cs // Author : Eric Woodruff (Eric@EWoodruff.us) -// Updated : 10/15/2022 +// Updated : 12/30/2022 // Note : Copyright 2006-2022, Eric Woodruff, All rights reserved // // Sandcastle Help File Builder common assembly attributes. @@ -84,19 +84,19 @@ internal static partial class AssemblyInfo // This is used to set the assembly version in the strong name. This should remain unchanged to maintain // binary compatibility with prior releases. It should only be changed if a breaking change is made that // requires assemblies that reference older versions to be recompiled against the newer version. - public const string StrongNameVersion = "2022.8.14.0"; + public const string StrongNameVersion = "2022.12.30.0"; // Common assembly file version // // This is used to set the assembly file version. This will change with each new release. MSIs only // support a Major value between 0 and 255 so we drop the century from the year on this one. - public const string FileVersion = "22.10.15.0"; + public const string FileVersion = "22.12.30.0"; // Common product version // // This may contain additional text to indicate Alpha or Beta states. The version number will always match // the file version above but includes the century on the year. - public const string ProductVersion = "2022.10.15.0"; + public const string ProductVersion = "2022.12.30.0"; // Assembly copyright information public const string Copyright = "Copyright \xA9 2006-2022, Eric Woodruff, All Rights Reserved"; diff --git a/SHFB/Source/SandcastleBuilderUtils/SandcastleBuilderUtils.csproj b/SHFB/Source/SandcastleBuilderUtils/SandcastleBuilderUtils.csproj index 4cd3c118..a12951d1 100644 --- a/SHFB/Source/SandcastleBuilderUtils/SandcastleBuilderUtils.csproj +++ b/SHFB/Source/SandcastleBuilderUtils/SandcastleBuilderUtils.csproj @@ -20,7 +20,7 @@ EWSoftware.SandcastleBuilder.Utils Sandcastle Help File Builder Utilities - 2022.8.14.0 + 2022.12.30.0 Eric Woodruff This contains the project, build engine, and Managed Extensibility Framework (MEF) classes used by the Sandcastle Help File Builder tool set and third-party tools. https://github.com/EWSoftware/SHFB/raw/master/SHFB/Source/SandcastleLogo.png diff --git a/SHFB/Source/SandcastleCore/GlobalSuppressions.cs b/SHFB/Source/SandcastleCore/GlobalSuppressions.cs index ed5e844f..b14fad92 100644 --- a/SHFB/Source/SandcastleCore/GlobalSuppressions.cs +++ b/SHFB/Source/SandcastleCore/GlobalSuppressions.cs @@ -49,3 +49,4 @@ [assembly: SuppressMessage("Design", "CA1056:URI-like properties should not be strings", Justification = "", Scope = "member", Target = "~P:Sandcastle.Core.PresentationStyle.Transformation.Elements.Markdown.SyntaxElement.BaseSourceCodeUrlArgName")] [assembly: SuppressMessage("Design", "CA1054:URI-like parameters should not be strings", Justification = "", Scope = "member", Target = "~M:Sandcastle.Core.PresentationStyle.Transformation.Elements.Markdown.SyntaxElement.#ctor(System.String)")] [assembly: SuppressMessage("Maintainability", "CA1508:Avoid dead conditional code", Justification = "", Scope = "member", Target = "~M:Sandcastle.Core.PresentationStyle.Transformation.Elements.Markdown.CodeElement.Render(Sandcastle.Core.PresentationStyle.Transformation.TopicTransformationCore,System.Xml.Linq.XElement)")] +[assembly: SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "", Scope = "member", Target = "~M:Sandcastle.Core.Reflection.AssemblyLocation.FromXml(System.Xml.Linq.XElement)~Sandcastle.Core.Reflection.AssemblyLocation")] diff --git a/SHFB/Source/SandcastleCore/Properties/AssemblyInfoShared.cs b/SHFB/Source/SandcastleCore/Properties/AssemblyInfoShared.cs index 58ff0ffe..f91cadd9 100644 --- a/SHFB/Source/SandcastleCore/Properties/AssemblyInfoShared.cs +++ b/SHFB/Source/SandcastleCore/Properties/AssemblyInfoShared.cs @@ -1,7 +1,7 @@ //=============================================================================================================== // System : Sandcastle Tools // File : AssemblyInfoShared.cs -// Updated : 10/15/2022 +// Updated : 12/30/2022 // Note : Copyright 2006-2022, Microsoft Corporation, All rights reserved // // Sandcastle tools common assembly attributes. @@ -67,19 +67,19 @@ internal static partial class AssemblyInfo // This is used to set the assembly version in the strong name. This should remain unchanged to maintain // binary compatibility with prior releases. It should only be changed if a breaking change is made that // requires assemblies that reference older versions to be recompiled against the newer version. - public const string StrongNameVersion = "2022.8.14.0"; + public const string StrongNameVersion = "2022.12.30.0"; // Common assembly file version // // This is used to set the assembly file version. This will change with each new release. MSIs only // support a Major value between 0 and 255 so we drop the century from the year on this one. - public const string FileVersion = "22.10.15.0"; + public const string FileVersion = "22.12.30.0"; // Common product version // // This may contain additional text to indicate Alpha or Beta states. The version number will always match // the file version above but includes the century on the year. - public const string ProductVersion = "2022.10.15.0"; + public const string ProductVersion = "2022.12.30.0"; // Assembly copyright information public const string Copyright = "Copyright \xA9 2006-2022, Microsoft Corporation, All Rights Reserved.\r\n" + diff --git a/SHFB/Source/SandcastleCore/Reflection/AssemblyLocation.cs b/SHFB/Source/SandcastleCore/Reflection/AssemblyLocation.cs index 6d7c5c6f..41a274b8 100644 --- a/SHFB/Source/SandcastleCore/Reflection/AssemblyLocation.cs +++ b/SHFB/Source/SandcastleCore/Reflection/AssemblyLocation.cs @@ -2,8 +2,8 @@ // System : Sandcastle Tools - Sandcastle Tools Core Class Library // File : AssemblyLocation.cs // Author : Eric Woodruff (Eric@EWoodruff.us) -// Updated : 04/06/2021 -// Note : Copyright 2012-2021, Eric Woodruff, All rights reserved +// Updated : 12/30/2022 +// Note : Copyright 2012-2022, Eric Woodruff, All rights reserved // // This file contains a class that is used to contain information about a location and the assemblies for a // specific location. @@ -168,6 +168,43 @@ internal static AssemblyLocation FromXml(XElement location) { AssemblyLocation al = new AssemblyLocation(location.Attribute("Path").Value); + try + { + if(!Directory.Exists(al.Path)) + { + string path = IOPath.GetDirectoryName(al.Path); + + // .NETCore and .NET 5+ folders may not exist if the user hasn't got the version used in the + // reflection data set installed. In such cases, use the latest one installed. + if(path.EndsWith(@"\ref", StringComparison.OrdinalIgnoreCase)) + { + path = IOPath.GetDirectoryName(IOPath.GetDirectoryName(path)); + + var latestVersion = Directory.EnumerateDirectories(path).Select( + p => new { Version = IOPath.GetFileName(p), Path = p }).Where(p => + Version.TryParse(p.Version, out _)).OrderByDescending(p => p.Version).FirstOrDefault(); + + if(latestVersion != null) + { + path = IOPath.Combine(latestVersion.Path, "ref"); + + if(Directory.Exists(path)) + { + path = Directory.EnumerateDirectories(path).FirstOrDefault(); + + if(path != null) + al = new AssemblyLocation(path); + } + } + } + } + } + catch(Exception ex) + { + // Ignore exceptions and just use the path given + System.Diagnostics.Debug.WriteLine(ex); + } + foreach(var a in location.Descendants("AssemblyDetails")) al.assemblyDetails.Add(AssemblyDetails.FromXml(al.Path, a)); @@ -245,10 +282,12 @@ public void DetermineAssemblyDetails(bool clearAndRefresh) if(File.Exists(assemblyName + ".dll")) assemblyName += ".dll"; else + { if(File.Exists(assemblyName + ".winmd")) assemblyName += ".winmd"; else assemblyName = null; + } if(assemblyName != null) { @@ -274,10 +313,12 @@ public void DetermineAssemblyDetails(bool clearAndRefresh) if(File.Exists(assemblyName + ".dll")) assemblyName += ".dll"; else + { if(File.Exists(assemblyName + ".winmd")) assemblyName += ".winmd"; else assemblyName = null; + } if(assemblyName != null) { diff --git a/SHFB/Source/SandcastleCore/Reflection/ReflectionDataSet.cs b/SHFB/Source/SandcastleCore/Reflection/ReflectionDataSet.cs index 1f774d40..fee1c162 100644 --- a/SHFB/Source/SandcastleCore/Reflection/ReflectionDataSet.cs +++ b/SHFB/Source/SandcastleCore/Reflection/ReflectionDataSet.cs @@ -2,8 +2,8 @@ // System : Sandcastle Tools - Sandcastle Tools Core Class Library // File : ReflectionDataSet.cs // Author : Eric Woodruff (Eric@EWoodruff.us) -// Updated : 04/06/2021 -// Note : Copyright 2012-2021, Eric Woodruff, All rights reserved +// Updated : 12/30/2022 +// Note : Copyright 2012-2022, Eric Woodruff, All rights reserved // // This file contains a class used to contain information used to obtain reflection data and comments for a // specific set of assemblies. @@ -530,6 +530,7 @@ public IEnumerable CommentsFileLocations(CultureInfo language) string path; foreach(var l in assemblyLocations) + { if(platform != PlatformType.DotNetPortable || version.Major != 4 || version.Minor > 0) { // If localized, the comments files will be in a sub-folder based on the language @@ -545,8 +546,7 @@ public IEnumerable CommentsFileLocations(CultureInfo language) path = CultureSpecificCommentsFileFolder(l, CultureInfo.CurrentCulture); // If not found, check for localized versions using the default English language - if(path == null && !CultureInfo.CurrentCulture.Name.StartsWith("en", - StringComparison.OrdinalIgnoreCase)) + if(path == null && !CultureInfo.CurrentCulture.Name.StartsWith("en", StringComparison.OrdinalIgnoreCase)) path = CultureSpecificCommentsFileFolder(l, CultureInfo.GetCultureInfo("en")); // If no culture-specific folder was found, try the same location as the assemblies @@ -568,6 +568,7 @@ public IEnumerable CommentsFileLocations(CultureInfo language) path = Path.Combine(externalPath, language.Name); } else + { if(language != null && Directory.Exists(Path.Combine(externalPath, language.TwoLetterISOLanguageName)) && Directory.EnumerateFiles( Path.Combine(externalPath, language.TwoLetterISOLanguageName), "*.xml").Any()) @@ -576,6 +577,7 @@ public IEnumerable CommentsFileLocations(CultureInfo language) } else path = externalPath; + } } } @@ -583,6 +585,7 @@ public IEnumerable CommentsFileLocations(CultureInfo language) yield return Path.Combine(path, "*.xml"); } else + { if(Directory.Exists(l.Path)) { // The .NET Portable Library Framework 4.0 duplicates most of its comments files across @@ -608,6 +611,8 @@ public IEnumerable CommentsFileLocations(CultureInfo language) yield return Path.Combine(g.Key, Path.GetFileName(f)); } } + } + } } /// @@ -626,14 +631,18 @@ private static string CultureSpecificCommentsFileFolder(AssemblyLocation locatio if(Directory.Exists(Path.Combine(path, language.Name))) path = Path.Combine(path, language.Name); else + { if(Directory.Exists(Path.Combine(path, language.TwoLetterISOLanguageName))) path = Path.Combine(path, language.TwoLetterISOLanguageName); else path = null; + } if(path != null && !location.IncludedAssemblies.Any(a => File.Exists(Path.ChangeExtension( Path.Combine(path, Path.GetFileName(a.Filename)), ".xml")))) + { path = null; + } return path; } @@ -653,8 +662,10 @@ public bool ContainsAssembly(string assemblyName) throw new ArgumentNullException(nameof(assemblyName)); if(assemblyName.IndexOf(',') != -1) + { return assemblyLocations.Any(al => al.IncludedAssemblies.Any(a => assemblyName.StartsWith( a.Description, StringComparison.OrdinalIgnoreCase) && File.Exists(a.Filename))); + } return assemblyLocations.Any(al => al.IncludedAssemblies.Any(a => assemblyName.Equals(a.Name, StringComparison.OrdinalIgnoreCase) && File.Exists(a.Filename))); @@ -685,8 +696,10 @@ public AssemblyDetails FindAssembly(string assemblyName) StringComparison.OrdinalIgnoreCase) && File.Exists(a.Filename)); } else + { ad = al.IncludedAssemblies.FirstOrDefault(a => assemblyName.Equals(a.Name, StringComparison.OrdinalIgnoreCase) && File.Exists(a.Filename)); + } if(ad != null) break; @@ -735,6 +748,7 @@ public IEnumerable GetReferencedNamespaces(CultureInfo language, el => (string)el.Attribute("cref")).Where(c => c != null); foreach(string refId in crefs) + { if(refId.Length > 2 && refId[1] == ':' && refId.IndexOfAny(new[] { '.', '(' }) != -1) { ns = refId.Trim(); @@ -763,6 +777,7 @@ public IEnumerable GetReferencedNamespaces(CultureInfo language, yield return ns; } } + } } } #endregion diff --git a/SHFB/Source/SandcastleCore/SandcastleCore.csproj b/SHFB/Source/SandcastleCore/SandcastleCore.csproj index a59db4f4..1a2e271f 100644 --- a/SHFB/Source/SandcastleCore/SandcastleCore.csproj +++ b/SHFB/Source/SandcastleCore/SandcastleCore.csproj @@ -20,7 +20,7 @@ EWSoftware.Sandcastle.Core Sandcastle Tools Core Class Library - 2022.8.14.0 + 2022.12.30.0 Eric Woodruff This contains a set of core base classes and Managed Extensibility Framework (MEF) classes common to the Sandcastle Help File Builder tool set and third-party tools. https://github.com/EWSoftware/SHFB/raw/master/SHFB/Source/SandcastleLogo.png diff --git a/SHFB/Source/Setup/DeploymentFiles.wxs b/SHFB/Source/Setup/DeploymentFiles.wxs index c185371e..42404ee6 100644 --- a/SHFB/Source/Setup/DeploymentFiles.wxs +++ b/SHFB/Source/Setup/DeploymentFiles.wxs @@ -982,6 +982,9 @@ + + + @@ -1063,6 +1066,9 @@ + + + @@ -1099,12 +1105,21 @@ + + + + + + + + + @@ -1231,6 +1246,12 @@ + + + + + + @@ -1240,6 +1261,9 @@ + + + @@ -1294,6 +1318,9 @@ + + + @@ -1588,6 +1615,9 @@ + + + @@ -1633,6 +1663,9 @@ + + + @@ -1696,6 +1729,9 @@ + + + @@ -1738,6 +1774,9 @@ + + + @@ -1753,6 +1792,15 @@ + + + + + + + + + @@ -1771,6 +1819,9 @@ + + + @@ -1834,6 +1885,12 @@ + + + + + + @@ -1852,6 +1909,9 @@ + + + @@ -4361,6 +4421,7 @@ + @@ -4388,6 +4449,7 @@ + @@ -4400,8 +4462,11 @@ + + + @@ -4444,9 +4509,12 @@ + + + @@ -4465,6 +4533,7 @@ + @@ -4563,6 +4632,7 @@ + @@ -4578,6 +4648,7 @@ + @@ -4599,6 +4670,7 @@ + @@ -4613,17 +4685,22 @@ + + + + + @@ -4645,12 +4722,15 @@ + + + diff --git a/SHFB/Source/VSIX_VS2017/Templates/Projects/BuildComponentCS/BuildComponent.csproj b/SHFB/Source/VSIX_VS2017/Templates/Projects/BuildComponentCS/BuildComponent.csproj index ce890ebb..99711715 100644 --- a/SHFB/Source/VSIX_VS2017/Templates/Projects/BuildComponentCS/BuildComponent.csproj +++ b/SHFB/Source/VSIX_VS2017/Templates/Projects/BuildComponentCS/BuildComponent.csproj @@ -51,7 +51,7 @@ - + - - + + diff --git a/SHFB/Source/VSIX_VS2017/Templates/Projects/ConfigEditorVB/ConfigEditor.vbproj b/SHFB/Source/VSIX_VS2017/Templates/Projects/ConfigEditorVB/ConfigEditor.vbproj index 6b6e1d0c..b0ccd2a6 100644 --- a/SHFB/Source/VSIX_VS2017/Templates/Projects/ConfigEditorVB/ConfigEditor.vbproj +++ b/SHFB/Source/VSIX_VS2017/Templates/Projects/ConfigEditorVB/ConfigEditor.vbproj @@ -17,7 +17,7 @@ --> - - + + diff --git a/SHFB/Source/VSIX_VS2017/Templates/Projects/PlugInCS/PlugIn.csproj b/SHFB/Source/VSIX_VS2017/Templates/Projects/PlugInCS/PlugIn.csproj index 32fc8a1d..060ade49 100644 --- a/SHFB/Source/VSIX_VS2017/Templates/Projects/PlugInCS/PlugIn.csproj +++ b/SHFB/Source/VSIX_VS2017/Templates/Projects/PlugInCS/PlugIn.csproj @@ -51,8 +51,8 @@ - - + +