Chris Calvert
Chris Calvert

Reputation: 129

500 error reaching api endpoint when body object contains a property of System.Net.Mail.Attachment after upgrading to .NET 8

We upgraded our Web APIs from .NET 7 to .NET 8 recently, and now any of our endpoints that accept classes containing attachment properties (System.Net.Mail.Attachment) are unreachable. It doesn't matter if the property is a single Attachment type or a collection of attachments.

All we get now when trying to call those endpoints are 500 server errors, even when using swagger or postman. I tried to take a closer look at what might be going on, but the breakpoint within the controller method doesn't even get hit, and the console logs provide no help other than 500 server error.

I created branches right before the upgrade and right after and confirmed it is due to the .net 8 upgrade.

Does anyone have any idea as to what might be causing this? I tried to look if it was as simple as needing to upgrade references, but those are all latest.

Upvotes: 0

Views: 37

Answers (0)

Related Questions