Skip to content

Commit

Permalink
Use assembly version instead of package version, to prevent crash on …
Browse files Browse the repository at this point in the history
…unpackaged app settings (#1175)

* Use assembly version instead of package version, to prevent crash on unpackaged app settings

* Update versions

* unintended add
  • Loading branch information
Scottj1s authored Jan 26, 2023
1 parent dbff666 commit 18c1276
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
3 changes: 2 additions & 1 deletion WinUIGallery/Package.WAP.Dev.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap mp uap3">
<Identity Name="Microsoft.WinUI3ControlsGallery.Debug" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" Version="1.3.16.0" />
<!--Note: package version and assembly version must be kept in sync-->
<Identity Name="Microsoft.WinUI3ControlsGallery.Debug" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" Version="1.3.17.0" />
<mp:PhoneIdentity PhoneProductId="0ba9d13a-a477-463f-955f-91d935fa4cd5" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>WinUI 3 Gallery Dev</DisplayName>
Expand Down
3 changes: 2 additions & 1 deletion WinUIGallery/Package.WAP.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap mp uap3">
<Identity Name="Microsoft.WinUI3ControlsGallery" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" Version="1.3.16.0" />
<!--Note: package version and assembly version must be kept in sync-->
<Identity Name="Microsoft.WinUI3ControlsGallery" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" Version="1.3.17.0" />
<mp:PhoneIdentity PhoneProductId="863667e0-667a-4bb4-ac52-c59656c7333a" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>WinUI 3 Gallery</DisplayName>
Expand Down
15 changes: 8 additions & 7 deletions WinUIGallery/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
using System.Reflection;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AppUIBasics")]
[assembly: AssemblyTitle("WinUIGallery")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AppUIBasics")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyProduct("WinUIGallery")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -24,6 +24,7 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: ComVisible(false)]
// Note: package version and assembly version must be kept in sync
[assembly: AssemblyVersion("1.3.17.0")]
[assembly: AssemblyFileVersion("1.3.17.0")]
[assembly: ComVisible(false)]
2 changes: 1 addition & 1 deletion WinUIGallery/SettingsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public string Version
{
get
{
var version = Windows.ApplicationModel.Package.Current.Id.Version;
var version = System.Reflection.Assembly.GetEntryAssembly().GetName().Version;
return string.Format("{0}.{1}.{2}.{3}", version.Major, version.Minor, version.Build, version.Revision);
}
}
Expand Down

0 comments on commit 18c1276

Please sign in to comment.