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

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();

Who is Participating?
Did you try?

Dim sf as ISchedularFactory = new StdSchedularFactory()
Dim sched As ISchedular = sf.GetSchedular()
É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()
JMO9966Author Commented:
That's the syntax I was using, thanks.

I discovered my issue was missing assemblies.
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.