Preqrequisite
- There are n versions of Web Application A.
- Creating Objects in A from UI creates its own database.
- When Application A is opened the URL which represents the path of version takes care of respective version when clicking on objects created in step 2
- Now to avoid making changes to code everytime based on clients request, A C# script addition facility is already provided in system. Which is being compiled during runtime and executed if already added in system. E.g. at the end of update from UI send a file to a location. This script has same namespace as our Application A and uses its property and methods
- System uses reflection to compile script and create instance of it and invoke its method based on its type e.g. the type of that is some Interface
Requirement I have an application B which updates to DB but now also has to perform same operation as mentioned in 4,5 for application A(this can be of any version, version found at runtime and assemblies are stored separately and can be derived using Assembly.Load).
SO I used reflection and somehow reached to the point where i can successfully compile the script but unable to proceed further from that.
1st problem :- The compiled script requires the the application A assembly for execution as namespace is same for both and script internally uses A's methods and properties. But this assembly must be present at dynamic location i.e. of Appdomain.current.dynamicdirectory, whose path cant be defined beforehand. This can be solved only if Application A's assembly is being referenced in source project of B, but then again question is if I am dealing with multiple versions how to add them all in source project
Questions
-
Tried using Appdomain to set new appdomain but could not use it since I cannot modify Application A to have its proxyObject or to make its serializable since code is freezed.
-
Thought of building a seperate web application but question is again how to make script inside Assembly A to invoke its content. so that process can be performed
Aucun commentaire:
Enregistrer un commentaire