Question

I have a third-party unmanaged program as a part of my application. I have a managed C# application as well which is an "entry point" for the system. It ensures that the unmanaged program can only be run properly if certain conditions are met.

I'd like to have the C# application run the unmanaged program in a sandbox so that a particular file isn't directly read from or written to the hard drive; instead the C# app needs to process it and then feed the file to the 3rd-party application or save it to the disk.

I've looked into using the AppDomain class of C# but I believe only managed code can be run by it. Is there an alternative system for what I'm trying to accomplish?

Was it helpful?

Solution

Pretty sure you can't really run an unmanaged program in a C# sandbox, save for writing an unmanaged emulator in C# and running the unmanaged executable in that. And it'd be slow to run and hard to write so you probably don't want to go that route.

The only way I could see this working would be if the unmanaged program called a C# wrapper for the file system. Do you have the source code for the unmanaged program?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top