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

Posted on 2012-08-15
Last Modified: 2012-08-20
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();

Question by:JMO9966
    LVL 69

    Expert Comment

    by:Éric Moreau
    this is VB 101!

                '// First we must get a reference to a scheduler
                dim sf as new StdSchedulerFactory()
                dim sched as IScheduler = sf.GetScheduler()
    LVL 83

    Accepted Solution

    Did you try?

    Dim sf as ISchedularFactory = new StdSchedularFactory()
    Dim sched As ISchedular = sf.GetSchedular()

    Author Comment

    That's the syntax I was using, thanks.

    I discovered my issue was missing assemblies.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
    Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now