I'm re-thinking how to reuse common code across unrelated applications. (E.G. A method to convert an Exception into a well-formatted and useful text with all of it's inner exceptions included.)
I never thought I'd ever want anything from the C/C++ world added into .NET, but #include functionality (injecting raw code from another file into other source files) seems to be an ideal way to do this.
Keeping such code in its own .dll severely limits it's ability to be used across a wide variety of apps.
Keeping such code as snippets or templates covers that, but ends up being copypasta with no ability to update a function ubiquitously.
What do you guys use for cross-app code reuse?
I never thought I'd ever want anything from the C/C++ world added into .NET, but #include functionality (injecting raw code from another file into other source files) seems to be an ideal way to do this.
- Would give the ability to insert the code inside whatever namespace/class the host application expects utility functions to be at.
- Would keep things DRY, and allow central bug-fixing.
- Could be used any app, legacy or new without causing a stir. (What?!? You added a Common.Utilities namespace to my precious legacy app?!?? All such functionality must be in the LegacyApp.Shared.CommonTasks class library, or we will embark on HOLY WAR!!!)
- No deployment issues, since it wouldn't create a new .dll.
- Flexibiliy to use the include file as either a link (Would get central bug fixes) or as a copy (versionable)
Keeping such code in its own .dll severely limits it's ability to be used across a wide variety of apps.
Keeping such code as snippets or templates covers that, but ends up being copypasta with no ability to update a function ubiquitously.
What do you guys use for cross-app code reuse?