Can we invoke C # code in Uipath

Anymong

New member
Hi ,
I am trying to invoke some code using uipath 'invoke code 'activity.
Below is my code:
public class services
{
public static void StartService(string serviceName)
{
ServiceController service = new ServiceController(serviceName);
service.Start();
}
}

I am getting below error.
No compiled code to run
error CS1513: } expected At line 0
error CS1022: Type or namespace definition, or end-of-file expected At line 13

Can we do this using uipath ? is there any dependent package to resolve this issue?
 

SeanEAS

New member
Hi ,
I am trying to invoke some code using uipath 'invoke code 'activity.
Below is my code:
public class services
{
public static void StartService(string serviceName)
{
ServiceController service = new ServiceController(serviceName);
service.Start();
}
}

I am getting below error.
No compiled code to run
error CS1513: } expected At line 0
error CS1022: Type or namespace definition, or end-of-file expected At line 13

Can we do this using uipath ? is there any dependent package to resolve this issue?
Yes. Use the latest version of UiPath. In the Invoke Code activity there is a Language dropdown in the Properties tab that allows you to choose CSharp
 
Top