/n switch

The /n switch specifies the composition depth for composing metadata files.

mdmerge /n namespace_depth

Switch Options

namespace_depth

Specifies the namespace depth to compose into a single metadata file.

Remarks

Here are the possible value formats that you can specify with the /n switch.

Value format Description
Int32 > 0 Compose all types at the namespace depth specified in the switch.
-1 Compose all types into one IDL file per namespace.
<namespace>:Int32 > 0 Compose all types with matching namespace at the depth specified in the switch.
<namespace>:-1 Compose all types with matching namespace into one file per namespace.

The following table shows the results from different combinations of the /n switch working on these namespaces.

  • Windows.Foundation.Collections.IIterable
  • Windows.UI.DirectUI.Controls.Button
  • Windows.UI.DirectUI.Controls.ListView
  • Windows.UI.Immersive.Application.PlayTo.Target
  • Windows.Web.Syndication.RSS
Switches Result Explanation
/n:-1 /n:1 Windows.winmd The last /n switch overrides all previous –n switches.
/n:-1/n:Windows.UI:2
Windows.Foundation.winmd
Windows.UI.winmd
Windows.Web.Syndication.winmd
Windows.Foundation is always composed at –n:2.
Windows.UI types are grouped.
Windows.Web.Syndication is composed at n:-1.
/n:1/n:Windows.UI.DirectUI:3
Windows.Foundation.winmd
Windows.UI.DirectUI.winmd
Windows.winmd
Windows.Foundation is always composed at –n:2.
Windows.UI.DirectUI is composed at level 3.
All other types are composed at level 1.

Here are the rules for handling multiple instances of the /n switch.

  • The most specific instance prevails. For example, if you specify –n:A.B.C:4–n:A.B:5, MDMERGE resolves A.B.C.D at level 4, because A.B.C is more specific than A.B. A.B.E.F resolves at depth 5, because it matches A.B but not A.B.C.
  • The last instance prevails. For example, if you specify –n:5–n:2, the types are composed at level 2.
  • Both of these rules apply. If you specify –n:A.B.C:4 –n:A.B.C:1, namespace A.B.C is composed at level 1.

Examples

mdmerge.exe -metadata_dir $(SDK_METADATA_PATH) -i $(INTERNAL_SDK_METADATA_PATH) -o $(OBJ_PATH)\$O\SystemMetadata -v -n:-1 -n:Windows.Foundation:2

Requirements

Requirement Value
Client
Windows 8
Server
Windows Server 2012

See also

General MIDL Command-line Syntax