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> […]

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 […]