call c# written dll function from command line

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello together,

i'm trying to call some functions wirtten in c# and compiled as a type
library (dll) trough the windows cmd shell. Is this generally possible?

My first idea was it to use rundll32.exe to call my user defined function,
but if i try to make a call like this: rundll32.exe mylib.dll,myFunc
Param1,Param2

The srouce code looks like this example
namespace test {
class TestClass {
public static myFunc(int param1, string param2){
/*SourceCode*/
return (ReturnData)
}
}
}

Is there Something special i have to consider?

regards
Roland
 
Roli79 said:
Hello together,

i'm trying to call some functions wirtten in c# and compiled as a type
library (dll) trough the windows cmd shell. Is this generally possible?

AFAIK this isn't possible. I've certainly never found myself in a position
where I've needed to look too closely at it. Why not just create a console
project that forwards command line arguments to your library?

--
Regards,

Tim Haughton

Agitek
http://agitek.co.uk
http://blogitek.com/timhaughton
 
Dont know of any that exist out of the box, but you could write your own
console app that uses reflection to acquire the methodinfo on the
dll, and dynamically invoke it that way.
 
Back
Top