WCF Custom tool warning “Cannot import wsdl:portType”

Yet another odd problem to deal with today. “Custom tool warning: cannot import wsdl:portType Could not load file or assembly” Thanks to Nuget, it appears that it tries to load all assemblies when “Reuse types in all referenced assemblies” is marked. The WSDL tool doesn’t use the below setting so it fails. [code langauge=”xml”] <runtime> […]

SSMS – Application Intent ReadOnly

If you have an always on MSSQL availability group you can add applicationintent=readonly; to your connection string to connect as a read only user on the secondary mirror of your availability group. If you want to connect using Microsoft Sql Server Management Studio (SSMS) using the same intent, open a new window, hit connect, type […]

Unit Testing Web API Controllers with Headers

I couldn’t find a good example of how to unit test a controller with [code langauge=”csharp”] var headerValue = Request.Headers.GetValues("HEADER");[/code] in the controller. Not too common, but happens enough it can be expected. Also the controller inheirts “ApiController” which doesn’t inheirt from “ControllerBase” so the usual controller context call won’t work. Here is how I […]