简体   繁体   中英

Mono Compiler as a Service recompiling ASP.NET MVC site at runtime?

I found a fascinating link talking about using the Mono Compiler as Service to dynamically compile Controller classes at runtime:

http://blog.fusonic.net/2011/04/scripting-asp-net-mvc-controllers-at-runtime/

But it only works for Controllers. Can anyone out there shed any light on whether it would be possible to have an entire project evaluated at runtime? Although it would mean less compile-time error checking, it could still be a huge productivity boost.

It is possible to dynamically compile everything you put into the App_Code folder (including controllers, custom HTML and Url helpers etc) if you convert your project to the Web site project type (How to do it is described here) without a need for the compiler as a service.

The drawbacks are that you can't dynamically compile referenced libraries with your business logic or database access library. And there is a obvious performance drawback which can be partially eliminated by the IIS application warmup module.

Some argue that there is a security problem with deploying all source codes on your production servers, but the scripting world (Ruby on rails, python web framworks, php, node.js etc) doesn't seems to be much worried about this issue, and as far as you don't obfuscate your dll's there isn't much difference in the security of your intelectual property.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM