Skip to content

Commit

Permalink
Resolve different location config loader in UWP. (fixes mrbrl#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
soroshsabz committed Jul 8, 2022
1 parent 9715eb3 commit 8698bce
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/DemoApp/DemoApp.Droid/Resources/Resource.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/DemoApp/DemoApp.UWP/BundleArtifacts/arm.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
MainPackage=D:\Source\Repos\soroshsabz\PCLAppConfig\src\DemoApp\DemoApp.UWP\bin\ARM\Release\DemoApp.UWP_1.0.0.0_ARM.appx
SymbolPackage=D:\Source\Repos\soroshsabz\PCLAppConfig\src\DemoApp\DemoApp.UWP\obj\ARM\Release\Symbols\DemoApp.UWP_1.0.0.0_ARM.appxsym
2 changes: 2 additions & 0 deletions src/DemoApp/DemoApp.UWP/BundleArtifacts/x64.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
MainPackage=D:\Source\Repos\soroshsabz\PCLAppConfig\src\DemoApp\DemoApp.UWP\bin\x64\Release\DemoApp.UWP_1.0.0.0_x64.appx
SymbolPackage=D:\Source\Repos\soroshsabz\PCLAppConfig\src\DemoApp\DemoApp.UWP\obj\x64\Release\Symbols\DemoApp.UWP_1.0.0.0_x64.appxsym
2 changes: 2 additions & 0 deletions src/DemoApp/DemoApp.UWP/BundleArtifacts/x86.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
MainPackage=D:\Source\Repos\soroshsabz\PCLAppConfig\src\DemoApp\DemoApp.UWP\bin\x86\Release\DemoApp.UWP_1.0.0.0_x86.appx
SymbolPackage=D:\Source\Repos\soroshsabz\PCLAppConfig\src\DemoApp\DemoApp.UWP\obj\x86\Release\Symbols\DemoApp.UWP_1.0.0.0_x86.appxsym
11 changes: 9 additions & 2 deletions src/DemoApp/DemoApp.UWP/DemoApp.UWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,17 @@
<EnableDotNetNativeCompatibleProfile>true</EnableDotNetNativeCompatibleProfile>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<PackageCertificateKeyFile>DemoApp.UWP_TemporaryKey.pfx</PackageCertificateKeyFile>
<PackageCertificateKeyFile></PackageCertificateKeyFile>
<RuntimeIdentifiers>win10-arm;win10-arm-aot;win10-x86;win10-x86-aot;win10-x64;win10-x64-aot</RuntimeIdentifiers>
<PackageCertificateThumbprint>8CC0DB51E4184A5BE0382940D550D33E388BA5CF</PackageCertificateThumbprint>
<PackageCertificateThumbprint>EE2AD115C362325A8DD208D5CA44473FD9BF58A0</PackageCertificateThumbprint>
<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
<GenerateAppInstallerFile>False</GenerateAppInstallerFile>
<AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
<AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
<GenerateTestArtifacts>True</GenerateTestArtifacts>
<AppxBundle>Always</AppxBundle>
<AppxBundlePlatforms>x86|x64|arm</AppxBundlePlatforms>
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<DebugSymbols>true</DebugSymbols>
Expand Down
Binary file modified src/DemoApp/DemoApp.UWP/DemoApp.UWP_TemporaryKey.pfx
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
Expand All @@ -14,7 +15,15 @@ public string Path
get
{
string rootPath = Package.Current.InstalledLocation.Path;
return System.IO.Path.Combine(rootPath, "App.config");
string exeConfig = System.IO.Path.Combine(rootPath, Package.Current.DisplayName + ".exe.config");
if (!File.Exists(exeConfig))
{
return System.IO.Path.Combine(rootPath, "App.config");
}
else
{
return exeConfig;
}
}
}
}
Expand Down

0 comments on commit 8698bce

Please sign in to comment.