File download through WCF slower than through IIS

前端 未结 6 1742
孤独总比滥情好
孤独总比滥情好 2020-12-08 03:35

The following method (in which I hopefully did not make any mistakes while dramatically simplifying it for this post) is working properly and set up using the Streamed trans

6条回答
  •  清歌不尽
    2020-12-08 03:59

    Thanks for the information in this post. There's not a lot of information out there about this issue. I want to add some additional details that maybe helpful for others.

    Most of the responses here seem to indicate that people are using a single NetTcp endpoint or they are not hosting the WCF inside IIS.

    If you are using multiple netTcp endpoints in the same wcf service and its hosted inside IIS or using a container that uses WAS, you may run into these issues.

    1. If you change the ConnectionBufferSize for one NetTcp endpoint, all of them must be changed and they must be the same value. Apparently this is a requirement when being hosted in WAS (which is what IIS uses). (https://docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/how-to-host-a-wcf-service-in-was) Apparently its not an issue if you are self-hosting the webservice, but I have not verified this. So if you've added a customBinding for one NetTcp, but you're getting an activation exception about a TransportManager being missing, this is your problem.
    2. I couldn't get this this to work using the magic Configure method. Even with the basic NetTcp binding without much changes, I was getting a null response object. I'm sure there's a way to fix that, but I didn't have the time to keep digging into this.
    3. The way that worked for me was to use a customBinding. If you are using Transport security with Windows authentication you can just add So the binding ends up looking like this:
    
         
         
         
    
    

    You shouldn't have to change your client NetTcp configurations, of course that's if you are not using any additional features that aren't reflected here. For customBinding, the order of the sections are important. https://docs.microsoft.com/en-us/dotnet/framework/wcf/extending/custom-bindings

提交回复
热议问题