Message passing between processes
We've built a dll that we're using throughout our projects. Now, due to several reasons, we need to have that as an executable, but the problem is that it integrates with other solutions by throwing events.开发者_如何转开发
If we move it to be an executable how can we transform our code to maintain the functionality of events? (it can no longer reference the exe directly, it has to call it as a process)
For interprocess communication, see named pipes.
You have to do nothing since exe assemblies references as well as dll assemblies. The other stuff is up to you. If you are aware of accessing the executable while it is running, create another startup executable project directly referencing this executable, then run new executable using old executable.
Second question, why to do things so hard? Why not using the dll assemblies to share the code between projects?
To summarize, you can move the code which requires the main(..) body into the separate executable appication, whilst leaveing all the code intact in the original assembly dll.
精彩评论