How to properly escape a comma in makeappx.exe package process

Jack Dale 1 Reputation point
2022-02-09T18:54:25.607+00:00

When trying to package up a UWP application, we have our signing certificate specified in the Publisher section of the manifest. Unfortunately, our CN and Organization both have commas in the value.

Example:
<Identity Name="PKProtectExplorerIntegration" Publisher="CN=MSFT, INC, O=MSFT, INC, C=US" Version="1.0.0.0" />

When we try to run makeappx.exe pack /d Test /p Test.msix /nv

We see this error in the output because of the commas:
Output:
MakeAppx : error: Error info: error C00CE169: App manifest validation error: The app manifest must be valid as per schema: Line 14, Column 49, Reason: 'CN=MSFT, INC, O=MSFT, INC, C=US' violates pattern constraint of '(CN|L|O|OU|E|C|S|STREET|T|G|I|SN|DC|SERIALNUMBER|Description|PostalCode|POBox|Phone|X21Address|dnQualifier|(OID.(0|[1-9][0-9])(.(0|[1-9][0-9]))+))=(([^,+="<>#;])+|".")(, ((CN|L|O|OU|E|C|S|STREET|T|G|I|SN|DC|SERIALNUMBER|Description|PostalCode|POBox|Phone|X21Address|dnQualifier|(OID.(0|[1-9][0-9])(.(0|[1-9][0-9]))+))=(([^,+="<>#;])+|".")))*'.
The attribute 'Publisher' with value 'CN=MSFT, INC, O=MSFT, INC, C=US' failed to parse.

How do we properly escape a comma in the Publisher string?

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
39,089 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.