summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Ghiondea <ghiondea.alexandru@microsoft.com>2015-03-09 15:15:04 -0700
committerAlex Ghiondea <ghiondea.alexandru@microsoft.com>2015-03-10 11:50:06 -0700
commit93daf3d88ee0f713114eef0df172891fab943ef2 (patch)
tree49728f308181b92fff93c9bd0ff239b2f4e9e832
parent1644ae12020a1927bb9b7bb7b162ba8b1e8bc73e (diff)
downloadcoreclr-93daf3d88ee0f713114eef0df172891fab943ef2.tar.gz
coreclr-93daf3d88ee0f713114eef0df172891fab943ef2.tar.bz2
coreclr-93daf3d88ee0f713114eef0df172891fab943ef2.zip
Make sure that AppContext respects CompatibilitySwitches.IsAppSilverlight81 flag.
This flag is used in cases where we don't have a Main() which means we won't be able to read the TFM. Setting this compatibility flag will force the TFM to be 'WindowsPhone, Version=8.1".
-rw-r--r--src/mscorlib/src/System/AppContext/AppContextDefaultValues.cs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mscorlib/src/System/AppContext/AppContextDefaultValues.cs b/src/mscorlib/src/System/AppContext/AppContextDefaultValues.cs
index 4d83bf4f3c..4b685e5f7a 100644
--- a/src/mscorlib/src/System/AppContext/AppContextDefaultValues.cs
+++ b/src/mscorlib/src/System/AppContext/AppContextDefaultValues.cs
@@ -26,6 +26,19 @@ namespace System
[System.Security.SecuritySafeCritical]
private static void ParseTargetFrameworkName(out string identifier, out string profile, out int version)
{
+#if FEATURE_CORECLR
+ if (CompatibilitySwitches.IsAppSilverlight81)
+ {
+ // Since Silverlight apps don't have an explicit Main() the reading of the TFM
+ // will not work and as a workaround we use the CompatibilitySwitch.IsAppSilverlight81
+ // to identify if the given app targets SL 8.1 and accordingly give it the value WindowsPhone;80100
+ identifier = "WindowsPhone";
+ version = 80100;
+ profile = string.Empty;
+ return;
+ }
+#endif
+
string targetFrameworkMoniker = AppDomain.CurrentDomain.SetupInformation.TargetFrameworkName;
// If we don't have a TFM then we should default to the 4.0 behavior where all quirks are turned on.