From 154cdc62fd12263c698b0d632a9ac7fd1170b715 Mon Sep 17 00:00:00 2001 From: Developer01 Date: Mon, 29 Dec 2025 13:46:00 +0100 Subject: [PATCH] Migrate Config project to SDK style and clean up files Refactored Config.vbproj to use the modern SDK-style project format targeting net8.0-windows, replacing explicit assembly references with PackageReference entries and removing legacy MSBuild imports and settings. Deleted SampleConfig.vb, which contained a sample configuration class, and removed the obsolete packages.config file, consolidating NuGet package management into the project file. These changes modernize the project structure and streamline dependency management. --- Config/Config.vbproj | 122 +++++------------------------------------ Config/SampleConfig.vb | 70 ----------------------- Config/packages.config | 8 --- 3 files changed, 15 insertions(+), 185 deletions(-) delete mode 100644 Config/SampleConfig.vb delete mode 100644 Config/packages.config diff --git a/Config/Config.vbproj b/Config/Config.vbproj index 9739d4f1..824275b2 100644 --- a/Config/Config.vbproj +++ b/Config/Config.vbproj @@ -1,51 +1,24 @@ - - - - + - Debug - AnyCPU - {44982F9B-6116-44E2-85D0-F39650B1EF99} + net8.0-windows Library DigitalData.Modules.Config DigitalData.Modules.Config - 512 Windows - v4.6.2 - - - + true + true + enable + powershell.exe -command "& { &'$(SolutionDir)copy-binary.ps1' '$(TargetPath)' '$(TargetFileName)' '$(ConfigurationName)' '$(ProjectName)' }" - true - full - true - true - bin\Debug\ DigitalData.Modules.Config.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - pdbonly false - true - true - bin\Release\ DigitalData.Modules.Config.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - On - - - Binary - - - Off - - - On - ..\Base\bin\Debug\DigitalData.Modules.Base.dll @@ -57,105 +30,40 @@ False ..\Logging\bin\Debug\DigitalData.Modules.Logging.dll - - ..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll - - - ..\packages\EntityFramework.Firebird.6.4.0\lib\net452\EntityFramework.Firebird.dll - - - ..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll - - - ..\packages\FirebirdSql.Data.FirebirdClient.7.5.0\lib\net452\FirebirdSql.Data.FirebirdClient.dll - - - ..\packages\NLog.5.0.5\lib\net46\NLog.dll - - - - - ..\packages\System.Data.Odbc.6.0.1\lib\net461\System.Data.Odbc.dll - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - + True Application.myapp True - + True True Resources.resx - + True Settings.settings True - - VbMyResourcesResXFileCodeGenerator - Resources.Designer.vb - My.Resources - Designer - - - - - + MyApplicationCodeGenerator Application.Designer.vb - - SettingsSingleFileGenerator - My - Settings.Designer.vb - - - - - powershell.exe -command "& { &'$(SolutionDir)copy-binary.ps1' '$(TargetPath)' '$(TargetFileName)' '$(ConfigurationName)' '$(ProjectName)' }" - - - - Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}". - - - - - \ No newline at end of file diff --git a/Config/SampleConfig.vb b/Config/SampleConfig.vb deleted file mode 100644 index ba775c22..00000000 --- a/Config/SampleConfig.vb +++ /dev/null @@ -1,70 +0,0 @@ -Imports Config -Imports NLog - -''' -''' Sample Config Class inheriting from BaseConfig -''' -''' -''' -''' Things this class should do: -''' -''' - Provide defaults for all values -''' - Load the current config using the LoadConfig method of BaseConfig -''' - If no configfile was found, it should create a new datatable with only default values -''' - If a configfile was found, it should merge the values from this file with the defaults from this class -''' - For each propertyname defined in PropertyNames -''' - Check for existing value in datatable -''' - If a value is present, use it -''' - If no value is exists, use the default value -''' - Assign the resulting values to class properties -''' - Save the new config to disk -''' -Public Class SampleConfig - Inherits BaseConfig - - Private _logger As Logger - - Public ReadOnly ConnectionString As String - Public ReadOnly UniversalViewer As String - - Public Overloads ReadOnly Property PropertyNames As Dictionary(Of String, String) - Get - Return New Dictionary(Of String, String) From { - {"ConnectionString", ""}, - {"UniversalViewer", ""} - } - End Get - End Property - - Public Sub New(LogFactory As LogFactory) - MyBase.New(LogFactory) - - _logger = LogFactory.GetCurrentClassLogger() - - ' Load the existing values from the config file into PropertyNames - ' overwriting the default values - Dim oDataTable = LoadConfig() - - For Each oRow As DataRow In oDataTable.Rows - Dim oValue = oRow.Item(_configValue) - Dim oKey = oRow.Item(_configKey) - - PropertyNames.Item(oKey) = oValue - Next - - ' Assign the merged properties to class properties, optionally converting them beforehand - For Each oProperty As KeyValuePair(Of String, String) In PropertyNames - Select Case oProperty.Key - Case "ConnectionString" - ConnectionString = oProperty.Value - Case "UniversalViewer" - UniversalViewer = oProperty.Value - Case Else - _logger.Warn("Property {0} was found in PropertyNames but was not assigned to a config property", oProperty.Key) - End Select - Next - - ' Convert the dictionary back to a datatable and save it - SaveConfig(ConvertToDataTable(PropertyNames)) - End Sub -End Class diff --git a/Config/packages.config b/Config/packages.config deleted file mode 100644 index f5db64f3..00000000 --- a/Config/packages.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file