Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


ksmuthuk
2018-09-28T07:54:23Z
Hello,
We are trying to create an active-x object in .NET Code execute task with reference to Microsoft.CSharp namespace. We have two issues with this.

1. We do not have Micorsoft.CSharp.dll listed in available .NET Assemblies.
1.PNG
2. Even if we go ahead and refer to Microsoft.CSharp.ni.dll (available in the list of references), we run into below issue.
2.PNG

Please help us solving the issue.

Thanks,
Muthu
Sponsor
Forum information
Support
2018-09-28T08:20:54Z
Can you paste the code you use?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
ksmuthuk
2018-09-28T08:47:10Z
Below is the code:

using System;
using System.Reflection;
using Microsoft.CSharp;

public class Test
{
public static string SayHello()
{
dynamic wshShell = Activator.CreateInstance(Type.GetTypeFromProgID("WScript.Shell"));
wshShell.Popup("Hello, world!");
return "Hello world";
}
}
Support
2018-09-28T08:59:24Z
Thanks, I am passing this to our developers. We will get back to you.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Support
2018-10-22T09:46:31Z
Use this code instead:

Type wshType = Type.GetTypeFromProgID("WScript.Shell");
object wshShell = Activator.CreateInstance(wshType);
wshType.InvokeMember("Popup", BindingFlags.InvokeMethod, null, wshShell, new object[]

{ "Hello, world!" }
)

Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top