Skip to content

Commit 5f11aaf

Browse files
authored
Merge pull request #3 from joeloudjinz/dev
v0.9.1
2 parents 84e89d6 + f7073f2 commit 5f11aaf

File tree

5 files changed

+34
-17
lines changed

5 files changed

+34
-17
lines changed

Documentations/Directory.Build.targets Documentation.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,7 @@ Projects must define `IsModuleProject=true` to utilize the module-specific funct
120120

121121
## Implementation Notes
122122

123-
### Assembly Loading Considerations
124-
The `CopyLocalLockFileAssemblies` property is crucial for plugin architecture because:
125-
- It ensures all transitive dependencies are available in the local directory
126-
- The `AssemblyDependencyResolver` can properly locate dependencies when loading modules at runtime
127-
- Without this setting, module loading may fail due to missing dependency references
128-
129123
### Build Performance Tips
130-
- Use `SkipUnchangedFiles="true"` to minimize deployment overhead
131124
- Consider using this only for actual module projects (with `IsModuleProject=true`)
132125
- Monitor build times when adding new module projects to the solution
133126

Documentations/Directory.Packages.props Documentation.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Directory.Packages.props Documentation
22

33
## Table of Contents
4+
45
- [Overview](#overview)
56
- [File Type and Purpose](#file-type-and-purpose)
67
- [Detailed Logic Analysis](#detailed-logic-analysis)
@@ -11,75 +12,89 @@
1112

1213
## Overview
1314

14-
The `Directory.Packages.props` file is a MSBuild properties file that enables Central Package Management (CPM) across all projects in the HexInz solution. This file specifically addresses the "Diamond Dependency" problem by defining package versions in a single location, ensuring version consistency across all modules and projects.
15+
The `Directory.Packages.props` file is a MSBuild properties file that enables Central Package Management (CPM) across all projects in the
16+
solution. This file specifically addresses the "Diamond Dependency" problem by defining package versions in a single location, ensuring version
17+
consistency across all modules and projects.
1518

1619
## File Type and Purpose
1720

1821
**File Type**: MSBuild properties file (XML-based)
1922

2023
**Purpose**:
24+
2125
- Implements Central Package Management (CPM) for the entire solution
2226
- Prevents the "Diamond Dependency" problem in plugin architectures
2327
- Defines package versions in a single, centralized location
2428
- Ensures consistent dependency versions across all projects
2529

26-
The file leverages MSBuild's hierarchical property system to apply package version management automatically to all projects in subdirectories, eliminating the need to specify versions in individual project files.
30+
The file leverages MSBuild's hierarchical property system to apply package version management automatically to all projects in subdirectories,
31+
eliminating the need to specify versions in individual project files.
2732

2833
## Detailed Logic Analysis
2934

3035
### Central Package Management Enablement
36+
3137
```xml
3238
<PropertyGroup>
3339
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
3440
</PropertyGroup>
3541
```
3642

3743
**Logic**:
44+
3845
- Enables the Central Package Management feature introduced in .NET 6
3946
- Forces all projects to inherit package versions from this central file
4047
- Prevents individual projects from specifying their own package versions
4148
- Creates a single source of truth for package versions across the solution
4249

4350
### Package Version Definitions
51+
4452
```xml
4553
<ItemGroup>
4654
<PackageVersion Include="PackageName" Version="X.Y.Z"/>
4755
</ItemGroup>
4856
```
4957

5058
**Logic**:
59+
5160
- Defines package versions that will be applied to all projects referencing these packages
5261
- Organized into logical groups (Core Dependencies, Third Party Dependencies, Test)
5362
- Each package version is defined once and inherited by all projects in the solution
5463
- Specific version numbers ensure compatibility and prevent conflicts
5564

5665
### Diamond Dependency Problem Mitigation
66+
5767
The file specifically addresses:
68+
5869
- **Scenario**: Module A uses Newtonsoft.Json v13 while Module B uses Newtonsoft.Json v9
5970
- **Result**: The first loaded module's version wins, causing MethodNotFoundException at runtime for the second module
6071
- **Solution**: Enforces strict version alignment across all modules through centralized version management
6172

6273
## Benefits of Using Directory.Packages.props
6374

6475
### Dependency Conflict Prevention
76+
6577
- **Version Consistency**: All projects use the same version of each package
6678
- **Diamond Dependency Resolution**: Eliminates version conflicts in plugin architectures
6779
- **Runtime Stability**: Prevents MethodNotFoundException and other version-related crashes
6880
- **Predictable Behavior**: Modules are guaranteed to work with compatible dependency versions
6981

7082
### Centralized Management
83+
7184
- **Single Point of Control**: Update package versions in one file to affect the entire solution
7285
- **Reduced Redundancy**: No need to specify versions in individual project files
7386
- **Easier Updates**: Version updates apply to all projects simultaneously
7487
- **Audit Trail**: All package versions visible in one location
7588

7689
### Solution-Wide Consistency
90+
7791
- **Uniform Dependencies**: All projects use the same package versions
7892
- **Simplified Maintenance**: Package updates affect the entire solution consistently
7993
- **Developer Experience**: No need to remember to update versions across multiple files
8094
- **Build Reliability**: Eliminates version conflicts during builds
8195

8296
### Plugin Architecture Support
97+
8398
- **Module Compatibility**: Ensures all modules use compatible dependency versions
8499
- **Assembly Loading**: Prevents conflicts when modules are loaded at runtime
85100
- **Dependency Resolution**: Supports reliable plugin loading and execution
@@ -88,18 +103,21 @@ The file specifically addresses:
88103
## Drawbacks and Considerations
89104

90105
### Version Lock-in
106+
91107
- **Limited Flexibility**: Projects cannot use different versions of the same package
92108
- **Upgrade Challenges**: Some packages may break when upgraded simultaneously across all projects
93109
- **Dependency Constraints**: May force upgrades on dependencies not ready for newer versions
94110
- **Risk of Breaking Changes**: A single package update affects the entire solution
95111

96112
### Maintenance Overhead
113+
97114
- **Coordination Required**: All team members must be aware of the central package management
98115
- **Testing Burden**: Package updates require testing across all projects
99116
- **Update Planning**: Careful planning needed when updating package versions
100117
- **Conflict Resolution**: May need to resolve package conflicts when integrating new libraries
101118

102119
### Potential Compatibility Issues
120+
103121
- **Breaking Changes**: New package versions may introduce breaking changes across multiple projects
104122
- **API Incompatibility**: Some projects might need older versions of certain packages
105123
- **Upgrade Dependencies**: Complex dependency trees may be difficult to update simultaneously
@@ -108,25 +126,31 @@ The file specifically addresses:
108126
## Implementation Notes
109127

110128
### Required Project Configuration
129+
111130
Projects must not specify package versions explicitly when using this central file:
131+
112132
```xml
113133
<PackageReference Include="PackageName" />
114134
```
135+
115136
The version is automatically inherited from Directory.Packages.props.
116137

117138
### Version Update Strategy
139+
118140
- Thoroughly test all projects after updating package versions
119141
- Consider the impact on module compatibility in plugin architecture
120142
- Plan updates to minimize breaking changes across projects
121143
- Monitor for any conflicts introduced by updated dependencies
122144

123145
### Best Practices
146+
124147
- Keep package versions aligned with the .NET version being used (e.g., v9.0.0 packages with .NET 9.0)
125148
- Group related packages together for easier updates
126149
- Add comments for packages that require specific version constraints
127150
- Regularly review and update packages to maintain security and functionality
128151

129152
### Troubleshooting Common Issues
153+
130154
- **Version Conflicts**: Verify all projects are using the central package management
131155
- **Missing Dependencies**: Check that packages are defined in Directory.Packages.props
132156
- **Build Failures**: Ensure all required packages are properly versioned in the central file

InzDynamicModuleLoader.Core/InzDynamicModuleLoader.Core.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
<Nullable>enable</Nullable>
77

88
<PackageId>InzSoftwares.NetDynamicModuleLoader</PackageId>
9-
<Version>0.9.0</Version>
10-
<AssemblyVersion>0.9.0.0</AssemblyVersion>
11-
<FileVersion>0.9.0.0</FileVersion>
9+
<Version>0.9.1</Version>
10+
<AssemblyVersion>0.9.1.0</AssemblyVersion>
11+
<FileVersion>0.9.1.0</FileVersion>
1212
<Authors>Abdellah Addoun</Authors>
1313
<Company>InzSoftwares</Company>
1414
<Product>InzSoftwares.NetDynamicModuleLoader</Product>

InzDynamicModuleLoader.Core/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ This configuration ensures each dynamically loaded module includes all its depen
8383
dedicated `BuiltModules` directory in the solution directory where each dynamically loaded module's dependencies can be found and resolved correctly.
8484

8585
For more details about this file and its purpose, see
86-
the [Directory.Build.targets Documentation](../Documentations/Directory.Build.targets%20Documentation.md).
86+
the [Directory.Build.targets Documentation](https://github.com/joeloudjinz/InzDynamicModuleLoader/blob/main/Documentations/Directory.Build.targets%20Documentation.md).
8787

8888
### 3. Create a Module Project
8989

@@ -227,7 +227,7 @@ When using this approach, reference packages without specifying versions in your
227227
```
228228

229229
For more information about this file and its content, see
230-
the [Directory.Packages.props Documentation](../Documentations/Directory.Packages.props%20Documentation.md).
230+
the [Directory.Packages.props Documentation](https://github.com/joeloudjinz/InzDynamicModuleLoader/blob/main/Documentations/Directory.Packages.props%20Documentation.md).
231231

232232
## IAmModule Interface Explained
233233

@@ -244,7 +244,7 @@ showcases a real-world scenario where database infrastructure can be switched at
244244
This architecture demonstrates how to build flexible applications where infrastructure concerns can be swapped out dynamically, maintaining clean
245245
separation of concerns while enabling maximum flexibility.
246246

247-
For step-by-step instructions on how to run and understand the example, see the [Example Breakdown](../Documentations/Example%20Breakdown.md)
247+
For step-by-step instructions on how to run and understand the example, see the [Example Breakdown](https://github.com/joeloudjinz/InzDynamicModuleLoader/blob/main/Documentations/Example%20Breakdown.md)
248248
documentation.
249249

250250
## Troubleshooting

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ This configuration ensures each dynamically loaded module includes all its depen
8383
dedicated `BuiltModules` directory in the solution directory where each dynamically loaded module's dependencies can be found and resolved correctly.
8484

8585
For more details about this file and its purpose, see
86-
the [Directory.Build.targets Documentation](../Documentations/Directory.Build.targets%20Documentation.md).
86+
the [Directory.Build.targets Documentation](https://github.com/joeloudjinz/InzDynamicModuleLoader/blob/main/Documentations/Directory.Build.targets%20Documentation.md).
8787

8888
### 3. Create a Module Project
8989

@@ -226,7 +226,7 @@ When using this approach, reference packages without specifying versions in your
226226
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions"/>
227227
```
228228

229-
For more information about this file and its content, see the [Directory.Packages.props Documentation](../Documentations/Directory.Packages.props%20Documentation.md).
229+
For more information about this file and its content, see the [Directory.Packages.props Documentation](https://github.com/joeloudjinz/InzDynamicModuleLoader/blob/main/Documentations/Directory.Packages.props%20Documentation.md).
230230

231231
## IAmModule Interface Explained
232232

0 commit comments

Comments
 (0)