Company
Date Published
Author
Bruno Garcia, Simon Cropp
Word count
1094
Language
English
Hacker News points
None

Summary

The .NET plugin-based model, also known as the "add-in" or "extension" model, allows extension or customization of functionality by adding assemblies and config files to a directory that is scanned at application startup. However, this approach can lead to assembly conflicts due to the complex rules of assembly loading in .NET. The Sentry SDK for Unity experienced issues with UPM packages bundling the same DLLs, often with different versions, causing conflicts. To resolve these issues, the development team created a new tool called Alias, which performs the following steps: renaming dependencies with unique keys, patching references in target assemblies and dependencies, and resulting in a group of files that will not conflict with any assemblies loaded in the plugin context. The Alias tool is shipped as a dotnet CLI tool and can be used to resolve conflicts in UPM packages. Additionally, there is a draft proposal for Package shading on NuGet, which could potentially solve similar assembly conflict issues in the future.