المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Exposing the running assembly to run-time compiled code



C# Programming
03-28-2011, 11:30 AM
[background info]

For a project I'm working on I'm looking at using run-time compilation of regular cs files into an appdomain separate from the running assembly (to disallow filesystem and network access) and reference the objects the files define. This is becaues there will be alot of additions to the group of objects those files represent, while the core of the program should remain the same. I'm using the Microsoft.CSharp.CSharpCodeProvider object to do the compilation.

[/background info]

Now, I would like to expose the running assembly's public classes and interfaces so that the run-time compiled code may reference and make use of them. First and foremost it's for exposing an interface that every object compiled this way must implement. I am not completely sure how to accomplish this, even after trawling through intellisense and msdn.

Anybody got any clues for me?If I am unclear anywhere or additional info is needed, just ask!