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
This builds our shared functionality assembly for .NET Framework 4.7.2 as Microsoft.Private.Windows.Core with the same namespaces. This is for internal scenarios where we need this shared functionality on .NET Framework.
Static and default interface methods don't work on .NET Framework.
For our composition usages of static interfaces we build the same interface with instance methods and constrain the consuming types to `new()` as well so they can create a static instance of the `T` that they need.
On Framework we still use direct COM to look at existing COM objects. For CCWs, however, we let `Marshal` provide them on Framework. Most of the complexity around that is with unwrapping DataObject. I believe things should work as expected but it is a particular focus point for both testing and following up with issues when utilizing this code.
There are some CsWin32 tweaks that are necessary, notably around `IComIId`. Added partials for the COM classes where we needed them.
Framework only code is in the `Framework` subfolder and ingested through the previously committed shared polyfill project.
Some tests needed to be tweaked for a few reasons. One in particular was that some validated implementation details rather than functional.
Some shared test functionality (notably validators that depend on static numeric interfaces) was simply excluded on .NET Framework as it wasn't being used in the tests that we needed to multitarget. .NET Framework versions can be added if/when needed.
// Licensed to the .NET Foundation under one or more agreements.
2
2
// The .NET Foundation licenses this file to you under the MIT license.
3
3
4
-
usingSystem.Runtime.CompilerServices;
5
-
6
4
namespaceSystem;
7
5
8
6
internalstaticclassModuleInitializer
9
7
{
10
-
[ModuleInitializer]
8
+
#if NET
9
+
[Runtime.CompilerServices.ModuleInitializer]
10
+
#endif
11
11
[SuppressMessage("Usage","CA2255:The 'ModuleInitializer' attribute should not be used in libraries",Justification="Intentional use of module initializer to register trace listener.")]
0 commit comments