Skip to content

Commit

Permalink
Remove dead code for NetFx ASP.NET (#105115)
Browse files Browse the repository at this point in the history
Co-authored-by: Stephen Toub <stoub@microsoft.com>
  • Loading branch information
ericstj and stephentoub authored Jul 22, 2024
1 parent 4555974 commit 01da4f7
Showing 1 changed file with 1 addition and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,6 @@ public object SerializedValue
}
}

private static bool IsHostedInAspnet()
{
// See System.Web.Hosting.ApplicationManager::PopulateDomainBindings
return AppDomain.CurrentDomain.GetData(".appDomain") != null;
}

private object Deserialize()
{
object value = null;
Expand Down Expand Up @@ -112,25 +106,8 @@ private object Deserialize()
}
}
}
catch (Exception exception)
catch (Exception)
{
try
{
if (IsHostedInAspnet())
{
object[] args = new object[] { Property, this, exception };

const string webBaseEventTypeName = "System.Web.Management.WebBaseEvent, System.Web";
Type type = Type.GetType(webBaseEventTypeName, true);

type.InvokeMember("RaisePropertyDeserializationWebErrorEvent",
BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.InvokeMethod,
null, null, args, CultureInfo.InvariantCulture);
}
}
catch
{
}
}

if (throwBinaryFormatterDeprecationException)
Expand Down

0 comments on commit 01da4f7

Please sign in to comment.