Reputation: 670
I am making use of the app code folder to write on the fly macros using a web UI, this is working well when there are no compilation errors on the macros but as soon as i save a type the whole application goes down and is not recoverable until i manually fix the error over ftp for example.
Is there a way i can have the compiler skip the building of the App_Code.dll if there are errors?
I am using ASP.NEt MVC if that is at all relevent.
Upvotes: 0
Views: 202
Reputation: 670
I received an answer to this in a comment, a more consistent way to do what i am trying to achieve was to use the CSScript library which allow on the fly dynamic compilation of C Sharp code from either a file location or an input string. This avoids having to compile it into the main assembly at build time. Its faster and safer and provides more flexibility than using the App_Code folder.
As a side note a hybrid approach could also be achieved where you could use CSScript to compile any script before saving it to the App_Code folder, this would avoid cases where you would save code with errors into the App_Code folder.
Upvotes: 0