500 Error on File Upload

I am sure my angular client is not correct, but I am also pretty sure I shouldn’t be getting a 500 before getting to the service handler. The 500 does not occur if I remove the headers. This is a CORS btw.

DTO/Service Stub

    public class Upload
        public string AmazonAccountId { get; set; }

 public object Post(Upload request)
        { // doesn't get here...
            var foo = "";

type script client:

postFile() {
    console.log("uploading " + this.fileToUpload.name)
   this.http.post(this.baseUrl +"app-product/upload/" + this.selectedAccount, this.fileToUpload ,
    { headers: {'filename': this.fileToUpload.name, 'Content-Type': 'multipart/form-data'}, 
    withCredentials: true, reportProgress: true}).subscribe(


Request URL: https://localhost:8443/app-product/upload/40988
Request Method: POST
Status Code: 500 Internal Server Error
Remote Address:
Referrer Policy: no-referrer-when-downgrade
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Content-Type,enctype,filename
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Allow-Origin: http://localhost:4200
Content-Type: application/json; charset=utf-8
Date: Sat, 27 Oct 2018 14:12:22 GMT
Server: Kestrel
Transfer-Encoding: chunked
Vary: Accept
X-Powered-By: ServiceStack/5.20 NetCore/OSX
Provisional headers are shown
Accept: application/json, text/plain, /
Content-Type: multipart/form-data
DNT: 1
filename: Download.csv
Origin: http://localhost:4200
Referer: http://localhost:4200/upload
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36

The below client works… but still think the 500 is a bug.

return fetch(this.baseUrl +"app-product/upload/" + this.selectedAccount, {
          method: 'POST',
          headers: {
              Accept: 'application/json',
          credentials: "include",
          body: formData
      .then(r => {
          if (r.status == 200 || r.status == 0) {
          } else {
              alert("Error uploading Image: " + this.fileToUpload.name);

The headers aren’t showing what the cause of the 500 Exception is, the response body or if the HTTP Request sent was valid. Can you enable DebugMode and include the raw HTTP Request/Response Headers from Fiddler.

Hopefully it will then include the StackTrace of the Exception otherwise can you register Exception Handlers and include the contents of ex.ToString().

Adding the additional ServiceExceptionHandlers nor UncaughtExceptionHandlers did not produce a usable breakpoint or exception

Debugmode is on.

Fiddler on mac is a non starter.

In comparing the working client to the one that generates a 500, the non-working one actually does not have a request payload. (again, I knew the client was probably not right… but think this is a bit of a bug in service stack)

not urgent. I will create a reproducible sample when I have time