How to creata an instance of an Interface in VB.Net

I'm migrating a project from C# to VB.Net and need to mimic this successful C# code in VB.net.

These two lines of code runs successfully in the C# project. ISchedulerFactory and IScheduler are both Interfaces:

            // First we must get a reference to a scheduler
            ISchedulerFactory sf = new StdSchedulerFactory();
            IScheduler sched = sf.GetScheduler();


Thanks
JMO9966Asked:
Who is Participating?
 
CodeCruiserCommented:
Did you try?

Dim sf as ISchedularFactory = new StdSchedularFactory()
Dim sched As ISchedular = sf.GetSchedular()
0
 
Éric MoreauSenior .Net ConsultantCommented:
this is VB 101!

            '// First we must get a reference to a scheduler
            dim sf as new StdSchedulerFactory()
            dim sched as IScheduler = sf.GetScheduler()
0
 
JMO9966Author Commented:
That's the syntax I was using, thanks.

I discovered my issue was missing assemblies.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.