0

i have a C# application, and id like to be able to make a system, so that within the program, you can display the sourcecode of the application. easy enough so far right?

well, i need them to be able to edit that code, almost like the debug break option... then load the new code and continue without stopping the program. so my problem is, that when this app loads its several thousand lines of code, and it takes a good block of time. after its loaded, it needs to do several hundred operations before allowing user input the first time it loads. also, it has a tcp client in it, and it is very important that it does not get disconnected.

i want people to be able to edit the source, click a button, and wait a few seconds, and have the new code inserted and "rehashed" so to speak, without having to break the overall function of the application.

im looking thorough code examples where possible and an input weather this is possible or not

~ thanks

  • Are you asking how to do what you have stated, or is this your proposed solution to some sort of requirements and you want to know if it is doable? If it is the second, then there are other ways to go. For example, split the app into separate applications - one for doing the start up processing and its "several hundred operations" and one for running the users code. – James Gardner Oct 20 '09 at 04:46

2 Answers2

1

If you want to allow people to make arbitrary changes to your program, that would be very complex. However, if you want to let them change specific behavior (like rewriting a calculation algorithm) you could have a look at Microsoft.CSharp.CSharpCodeProvide as discussed here.

Community
  • 1
  • 1
Eric J.
  • 147,927
  • 63
  • 340
  • 553
1

I don't think you can do that (change a .net app without rebuilding it) but you can have dynamic code loaded and run at any time..

Some people use plugins with Boo, people can change the plugins and these can be loaded at any time by the main app.

But I would suggest you have a look at the Ruby usage inside SilverLight..

This is something completely different, but its something I'm reading on how to start playing with Dynamic code handling: here

Ric Tokyo
  • 6,577
  • 3
  • 30
  • 48