Open bragma opened 5 years ago
As an addenda, here is the minimal sample code:
https://github.com/bragma/TestFunction/tree/master/TestFunction
We already call AddMvc()
-- have you tried your solution without that? I believe all the services registered by AddMvcCore()
should already be registered.
We already call
AddMvc()
-- have you tried your solution without that? I believe all the services registered byAddMvcCore()
should already be registered.
Do you mean that IFunctionsHostBuilder already has Mvc in its services and there is no need to do it again? Even for functions with queue trigger?
Is there a list of default services?
Thanks a lot!
We don't have a list of default services anywhere -- but it's a good idea. The Web host that runs the Functions host adds MVC (it has admin controllers that run, for example, even if you don't have an HttpTrigger). If you're able to get running, I can repurpose this issue to tackle the doc update.
@brettsam - moving this to triaged and adding "docs" tag
Hi, I am trying to use Razor Engine as a templating engine in a V2 function. I have it running locally, but not when deployed as a function. When selecting the function name from the portal, it gives "The function runtime is unable to start."
I've managed to strip everything down to a sample function with bare code and tried a lot of combinations with the basic initialization code, but not resolved.
Investigative information
Please provide the following:
Repro steps
I've built a sample HttpTrigger function from VS2019 template, and just added this:
I also tried with a more complex startup adding logging etc. but it gives the same error on the "AddMvcCore" line. If I comment that line, it works.
Actual behavior
Function does not run. Runtime does not start. Navigating to the function name tab in the portal shows a "function runtime is unable to start" error.
Related information
Provide any related information