locked
Include JS store project into C# store project in VS 2012 RRS feed

  • Question

  • Hi to everyone,

    I am developin a Windows 8 RT app. I have 2 separate projects in my solution:

    1. C# store project 

    2. JS store project

    It is possible to include JS project into my C# project?

    My guess is that I could call index.html from JS project in WebView component in C# store project.

    Did anyone had a problem like this?

    Regards

    Blaz

    Tuesday, August 20, 2013 5:47 PM

Answers

  • No, you cannot mix the projects that way. You can include portable HTML & JavaScript in a WebView, but not a full store app: the WebView content cannot interact with the Windows Runtime.

    You can use an HTML & JavaScript app for your UI and have it call a Windows Runtime Component written in C# or C++.

    --Rob

    • Marked as answer by Anne Jing Tuesday, August 27, 2013 2:53 AM
    Tuesday, August 20, 2013 5:57 PM
    Moderator

All replies

  • No, you cannot mix the projects that way. You can include portable HTML & JavaScript in a WebView, but not a full store app: the WebView content cannot interact with the Windows Runtime.

    You can use an HTML & JavaScript app for your UI and have it call a Windows Runtime Component written in C# or C++.

    --Rob

    • Marked as answer by Anne Jing Tuesday, August 27, 2013 2:53 AM
    Tuesday, August 20, 2013 5:57 PM
    Moderator
  • No, you cannot mix the projects that way. You can include portable HTML & JavaScript in a WebView, but not a full store app: the WebView content cannot interact with the Windows Runtime.

    You can use an HTML & JavaScript app for your UI and have it call a Windows Runtime Component written in C# or C++.

    --Rob

    It's possible to make win runtime component from entire C# store project? (XAML pages + C#)

    I have the UI written in C# store project and core in JS store.

    Wednesday, August 21, 2013 2:56 PM
  • No. You can use a C# component for core functionality in a JavaScript app, but you cannot write a component in JavaScript to use in a C# apo.

    The UI has to be in the main project, not the component. You cannot display Xaml in an HTML project. 

    --Rob

    Wednesday, August 21, 2013 3:04 PM
    Moderator
  • No. You can use a C# component for core functionality in a JavaScript app, but you cannot write a component in JavaScript to use in a C# apo.

    The UI has to be in the main project, not the component. You cannot display Xaml in an HTML project. 

    --Rob

    Can I import like it was a library or dll my JS store project into C# store project? And then on some XAML page in web view call default.html from JS project?
    Wednesday, August 21, 2013 6:26 PM
  • No, you cannot create a library in JavaScript which can be imported into a C# project.

    --Rob

    Wednesday, August 21, 2013 8:58 PM
    Moderator