You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WPF used to build one of its assemblies, PresentationCore, as a hybrid between C++/CLI and C#. In an effort to reduce our dependencies on NetModule and make our build cleaner, we split the C++/CLI portion into a new DLL.
We relied on the use of Module Initialization in PresentationCore in order to properly configure defaults for WPF applications. Due to the split, this was no longer possible to do purely in code as we had used the C++/CLI portion to add this before.
This is now accomplished via IL injection via IL(D)Asm in order to add this back to a pure C# assembly. This isn't a very sustainable way of doing this and we're worried about this breaking in the future.
WPF would like a supported way to add a module initializer to a C# assembly. Perhaps a compiler flag/msbuild property that allows a developer to specify a type/function to call on initialization of the module.
You can see how WPF is doing this (a fairly common idiom):
WPF used to build one of its assemblies,
PresentationCore
, as a hybrid between C++/CLI and C#. In an effort to reduce our dependencies onNetModule
and make our build cleaner, we split the C++/CLI portion into a new DLL.We relied on the use of Module Initialization in
PresentationCore
in order to properly configure defaults for WPF applications. Due to the split, this was no longer possible to do purely in code as we had used the C++/CLI portion to add this before.This is now accomplished via IL injection via IL(D)Asm in order to add this back to a pure C# assembly. This isn't a very sustainable way of doing this and we're worried about this breaking in the future.
WPF would like a supported way to add a module initializer to a C# assembly. Perhaps a compiler flag/msbuild property that allows a developer to specify a type/function to call on initialization of the module.
You can see how WPF is doing this (a fairly common idiom):
Something like this would provide an easy way to access this functionality with, it seems to me, minimal risk to breaking existing builds.
The text was updated successfully, but these errors were encountered: