AspDotNetAtoms.com provides daily updates on ASP.NET Tutorials, Programming Resources, .NET Articles, Authors and more.

Categories

Recent Posts

ASP.NET 2.0 - Safely Compile And Execute Source Code Dynamically : Robbe Morris

Tuesday, August 26 2008

You've probably run across all sorts of code samples for dynamically compiling and running source code in .NET 2.0. Fortunately, this is fairly easy in .NET. What I haven't yet seen covered is a safe way to do this in an ASP.NET environment. The biggest problem you run into is that each time you compile your code (even if you use the exact same attributes and settings) is that a new duplicate assembly is loaded into memory. So, you could easily wind up with thousands and thousands of duplicate assemblies floating around in memory on your server because there is no facility in .NET 2.0 to unload an assembly from memory. I am currently working on an application that permits the creation and implementation of business rules at runtime to perform such tasks as data processing, validation, navigation, and calculation rules. In fact, we support user specific compiled rules in some rare instances. The requirements are far too complex to attempt to make these rules entirely database driven. In the end, actual C# compiled code is required...

Read More:
ASP.NET 2.0 - Safely Compile And Execute Source Code Dynamically : Robbe Morris
Also See:
ASP.NET Security [Part I] : Joydip Kanjilal
Handling Files and Directories from your web applications. : Rockin J
Executing async task in asp.net : Andrea Colaci
Testing Web Sites with HttpWebRequest : Eric Smith
Look What You Can Do with Silverlight 2 (Part 4 of 6): Web Services Support : ASP.NET Webcasts

Post your comment

Comment