Possible To Run Sample.cs In My Application ?

  • Thread starter Thread starter Coder
  • Start date Start date
C

Coder

Hello,

Can my application call a web service ? and web service returns a class file
? Then

May I run this "cs" file in my main application ? without compiling ?

Thanks

Coder @Toronto
 
Coder said:
Hello,

Can my application call a web service ? and web service returns a class
file ? Then

May I run this "cs" file in my main application ? without compiling ?

Thanks

Coder @Toronto

No.

Your application can call a web service, and the web service can return
anything that can be serialised as a string (i.e. you can not return a
file, but you can return the contents of a file). You can not run source
code without compiling it.
 
Coder,

Without compiling? No, you can't do that. However, you can use the
CSharpCodeProvider class in the Microsoft.CSharp namespace to compile the
code.
 
Hello,

Can my application call a web service ? and web service returns a class file
? Then

May I run this "cs" file in my main application ? without compiling ?

Thanks

Coder @Toronto

As Göran said, it's not possible to run without compiling, but it *is*
possible to compile a source "on the fly" from within your running
application. However, this would be a big security hole if you get
source code from some webservice!

Hans Kesting
 
Thanks for all,

My purpose is to install (using clickonce) main application to client as MDI
Form, this form will contain a treeview (holding some nodes) and every node
click will go same web service service(username, userpass, DesiredClassLib)
and will get a class library (as file or stream or byte[] or string,
whatever..) and this separate class libraries will have a generic method
ShowAsMDIChild() and will be shown in main application

Everytime a user wants to invoke a node, this cycle will run, and I do not
wanna keep class libraries' dlls on client physically.

and in the spotlight, security is not the issue this time :)

If (Thisispossible())
{
WhatMustBeTheCorrectWay();

Thanks();
}
else
{
Thanks();
}
 
Back
Top