locked
consruction intializaion error,please help

    Question

  • using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Navigation; using Microsoft.Phone.Controls; using Microsoft.Phone.Shell; using PhoneApp2.Resources; using Windows.Networking.Connectivity; namespace PhoneApp2 { public partial class MainPage : PhoneApplicationPage { // Constructor CellularApnContext cellularApncontext; public MainPage() { InitializeComponent(); // Sample code to localize the ApplicationBar //BuildLocalizedApplicationBar(); } protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); cellularApncontext =new CellularApnContext();/*the type "windows.networking.connectivity.cellularapncontext' has no constructors defined-IS THE ERROR */ } } }

    when I try to intialize cellularapncontext using above its showing- The type "windows.networking.connectivity.cellularapncontext' has no constructors defined



    • Edited by rahul raj987 Saturday, January 17, 2015 6:46 PM already there is ()
    Saturday, January 17, 2015 6:40 PM

Answers

  • Is this a phone project - because the docs say it isn't available for the phone:

    Requirements

    Minimum supported client

    Windows 8.1

    Minimum supported server

    Windows Server 2012 R2

    Minimum supported phone

    None supported


    Darin R.


    Sunday, January 18, 2015 5:29 PM

All replies

  • Hello,

    it should be: new CellularApnContext(); /* () is necessary for the Ctor-call. sieh also: CellularApnContext.CellularApnContext constructor */


    © 2015 Thomas Roskop

    Saturday, January 17, 2015 6:44 PM
  • Hello,

    it should be: new CellularApnContext(); /* () is necessary for the Ctor-call. sieh also


    there is () already in my code,i forgot to type it here,can someone please check the problem for me?
    Saturday, January 17, 2015 6:49 PM
  • Please some one help,I will be greatful.
    Saturday, January 17, 2015 7:37 PM
  • I'm sorry, but your code is right :o.

    As you can see here, the Construtkor is PUBLIC and has no Arguments. And thats why your code is right. 

    I'm sorry :(


    © 2015 Thomas Roskop Germany // Deutschland

    Saturday, January 17, 2015 7:41 PM
  • Is this a phone project - because the docs say it isn't available for the phone:

    Requirements

    Minimum supported client

    Windows 8.1

    Minimum supported server

    Windows Server 2012 R2

    Minimum supported phone

    None supported


    Darin R.


    Sunday, January 18, 2015 5:29 PM