In my ASP.NET 5 application, I generate a drop-down list thanks to the HtmlHelper. Anything works fine in localhost except in production, we have a 500 server error.
I was able to find the cast which is performed, on github, and it's performed into the MVC lib, precisely into the DefaultHtmlGenerator class :
This cast is performed when we want to render a drop-down list depending on the SelectList we pass in parameter.
We can see that the comment specify we have to use at least the version 4.5 of the framework. At the end of the stacktrace we see the version of the framework which is used in production :
However, the version 4.5 is installed on our server, and I tried to insert a web.config file into the wwwroot of the projet to force the target framework :
But it doesn't work, and we indicate correctly the framework we want to use into our project.json :
So my question is : can we use compilation targetFramework="4.5" and httpRuntime targetFramework="4.5" to force IIS for using the version 4.5 ?