If you don't mind making your .appxmanifest slightly harder to modify in the visual editor, you can turn it into a T4 Template, and regenerate your manifest before each build with an extra csproj parameter.
That allows you to make your appxmanifest change depending on your build configuration, so you can have a different Package Identity for both Debug and Release.
Modifications to Package.appxmanifest (renamed to Package.tt)
<#@ template hostspecific="true" language="C#" #>
<#@ output extension=".appxmanifest" #>
<#@ parameter type="System.String" name="BuildConfiguration" #>
<#
string version = "1.4.1.0";
// Get configuration name at Build time
string configName = Host.ResolveParameterValue("-", "-", "BuildConfiguration");
if (string.IsNullOrWhiteSpace(configName))
{
// Default to Debug at Design Time.
configName = "Debug";
}
#>
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5"
xmlns:genTemplate="http://schemas.microsoft.com/appx/developer/windowsTemplateStudio"
xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3"
IgnorableNamespaces="uap mp genTemplate uap3">
<#
if (configName == "Debug")
{
#><Identity
Name="MyAppDebugIdentity"
Publisher="MyDebugPublisher"
Version="<#=version#>" />
<#
}
else
{
#><Identity
Name="MyAppIdentityName"
Publisher="CN=blerb"
Version="<#=version#>" />
<#
}
#>
<!-- The rest of your package.appxmanifest file goes here -->
Add the following to your .csproj:
<PropertyGroup>
<!-- This is what will cause the templates to be transformed when the project is built (default is false) -->
<TransformOnBuild>true</TransformOnBuild>
<!-- Set to true to force overwriting of read-only output files, e.g. if they're not checked out (default is false) -->
<OverwriteReadOnlyOutputFiles>true</OverwriteReadOnlyOutputFiles>
<!-- Set to false to transform files even if the output appears to be up-to-date (default is true) -->
<TransformOutOfDateOnly>false</TransformOutOfDateOnly>
</PropertyGroup>
<ItemGroup>
<T4ParameterValues Include="BuildConfiguration">
<Value>$(Configuration)</Value>
<Visible>false</Visible>
</T4ParameterValues>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TextTemplating\Microsoft.TextTemplating.targets" />
This setup only works at Build time and will default to the debug identity otherwise: You can improve it somewhat by including EnvDte parsing in the template, but I didn't feel that was really needed here.