locked
[UWP]VS2015/WIN10 - Windows hosted app. Namespace Windows not recognised RRS feed

  • Question

  • Hi,

    I am face to a strange issue. I have created a windows hosted app with cortana integration. The vcd file is well integrated and Cortana is able to start the app in foreground. Inside my app, I have inserted a piece of javascript to augment the interactions but namespace Windows is not recognised:

    if (typeof Windows !== 'undefined' &&  typeof Windows.UI !== 'undefined' &&  typeof Windows.ApplicationModel !== 'undefined') {    .....  });} else {  console.log("Windows namespace is unavaiable");}

    ..."Windows namespace is unavailable" is always displayed in the console.

    When I try to see if "Windows" exists yes or not by pressing F12 within the app, the console first says "undifined" but then, lists the sub-namespaces correctly:

    console.log(Windows)
    undefined
    [object Windows]
    eval code (114) (1,1)
       {
          [functions]: ,
          __proto__: { },
          ApplicationModel: { },
          Data: { },
          Devices: { },
          Foundation: { },
          Gaming: { },
          Globalization: { },
          Graphics: { },
          Management: { },
          Media: { },
          Networking: { },
          Security: { },
          Services: { },
          Storage: { },
          System: { },
          UI: { },
          Web: { }
       }

    console.log(typeof Windows)
    undefined
    object
    eval code (121) (1,1)

    Printscreen of the console :

    Do you know what's wrong because the same app worked just until recently. I have tried to download existing projects from internet but in the exact same way, windows is not known.

    Thanks in advance for your help

    Regars

    Tuesday, July 21, 2015 6:34 PM

All replies

  • Try using window.Windows to access the Windows Runtime.

    Windows Store Developer Solutions, follow us on Twitter: @WSDevSol|| Want more solutions? See our blog

    Tuesday, July 21, 2015 10:23 PM
  • Hi,

    Thanks for your reply but window.Windows returns the same result unfortunately...

    I am a but surprise to be the only one with this issue however next to "undefined" and as visible in my printscreen, everything seems to be there.

    cdt

    Wednesday, July 22, 2015 9:45 PM
  • Do you have a simple repro which mimics this problem? If so, please share via OneDrive/Dropbox.

    Windows Store Developer Solutions, follow us on Twitter: @WSDevSol|| Want more solutions? See our blog

    Thursday, July 23, 2015 7:55 PM
  • Hi,

    For example this simple repro given by microsoft : http://microsoftedge.github.io/WebAppsDocs/en-US/win10/CreateHWA.htm  (link to github at the bottom)

    I was able to see the notifications 2 weeks ago and now because of the current issue, nothing is displayed.

    I have the feeling that the issue is there since the last upgrade of windows 10 however this is the english version so why I would be the only one....

    I can try to reinstall my PC from scratch but all the rest just works fine.

    Thanks

    Thursday, July 23, 2015 8:47 PM