-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebAssembly: Add PNSE for System.Net.Mail #38207
Conversation
Tagging subscribers to this area: @dotnet/ncl |
src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpClient.cs
Outdated
Show resolved
Hide resolved
Will anyone actually use this in the browser? I'm wondering if we should instead just add something along the lines of: <GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetsBrowser)' == 'true'">SR.SmtpNetworkDeliveryNotSupported</GeneratePlatformNotSupportedAssemblyMessage> to the project file. |
@stephentoub I can imagine someone wanting to create mail messages in the browser context and with this change the unit tests that create one in the file system work. |
Can you share what such a scenario looks like? What does someone do with a mail message they create in the browser's file system? |
Pass it to another library, inspect it locally, send it to an API, .... I don't have a super important use case in mind but it did work in the mono/mono WASM implementation and it was quick to make it work in dotnet/runtime so why not? 😄 |
Simply because it adds complication/complexity/maintenance burden, and it seems a bit far-fetched. But if you really believe it adds value, ok. |
It's not supported on WebAssembly so throw PlatformNotSupportedException.
5dba813
to
e98efd6
Compare
@stephentoub I changed the PR to throw PNSE instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks.
It's not supported on WebAssembly so throw PlatformNotSupportedException.