1
I have an app Webapi2 that implements some Apicontrollers.
This same application references a Assembly that implements some more.
All of these controllers utilize Attribute Routing, as in the following example:
[RoutePrefix("sample1.endpoint")]
public class SampleController : ApiController
{
[Route("")]
[HttpGet]
public HttpResponseMessage WebApiTest()
Define runAllManagedModulesForAllRequests="true"
in the web.config
, the application works perfectly - but I want to turn off this attribute (which can be quite costly in production).
However, if I adjust the value of runAllManagedModulesForAllRequests
for false, only local Apicontrollers are correctly mapped; calls to others generate one 404
.
Which part, probably obvious, I didn’t implement?
(cross-post: https://stackoverflow.com/questions/29376376/webapi-2-0-apicontrollers-in-another-assembly-fail-to-map-if-runallmanagedmodu)
It seems to me to be the way. Testing right now, thank you for the prompt response!
– OnoSendai
Let me know if it works.
– Miguel Angelo
@Onosendai You still need help with this?
– Miguel Angelo
Sorry to keep you waiting. The initial implementation didn’t work, but I suspect the controllers are being loaded in the Owin context (used by a parallel Signalr implementation). As there is still a chance your answer is correct, I would like to test this scenario.
– OnoSendai