Skip to content

Commit 28ad3bd

Browse files
committed
fix
1 parent 7384b97 commit 28ad3bd

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/libraries/Microsoft.Extensions.Configuration.Xml/src/XmlDocumentDecryptor.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,11 @@ public XmlReader CreateDecryptingXmlReader(Stream input, XmlReaderSettings? sett
102102
[RequiresUnreferencedCode(RequiresUnreferencedCodeMessage)]
103103
protected virtual XmlReader DecryptDocumentAndCreateXmlReader(XmlDocument document)
104104
{
105-
if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
106-
105+
#if !NETSTANDARD2_1 && !NETSTANDARD2_0 && !NETFRAMEWORK // TODO remove with https://github.com/dotnet/runtime/pull/107185
106+
if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException();
107+
#else
108+
#pragma warning disable CA1416
109+
#endif
107110
// Perform the actual decryption step, updating the XmlDocument in-place.
108111
EncryptedXml encryptedXml = _encryptedXmlFactory?.Invoke(document) ?? new EncryptedXml(document);
109112
encryptedXml.DecryptDocument();

src/libraries/Microsoft.Extensions.Hosting.Systemd/src/SystemdNotifier.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ public void Notify(ServiceState state)
4141
return;
4242
}
4343

44-
if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
44+
#if !NETSTANDARD2_1 && !NETSTANDARD2_0 && !NETFRAMEWORK // TODO remove with https://github.com/dotnet/runtime/pull/107185
45+
if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException();
46+
#else
47+
#pragma warning disable CA1416
48+
#endif
4549

4650
using (var socket = new Socket(AddressFamily.Unix, SocketType.Dgram, ProtocolType.Unspecified))
4751
{

0 commit comments

Comments
 (0)