Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7944623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:36:25+00:00 2026-06-04T00:36:25+00:00

SOLVED! See my self-answer below. I’m building two Metro-style apps using Javascript and HTML,

  • 0

SOLVED! See my self-answer below.


I’m building two Metro-style apps using Javascript and HTML, which will have different presentation layers but a lot of similar functionality under the hood. Thanks to the ability to call C# methods from Javascript, I can factor a lot of the “common” functionality into a C# WinMd library that can then be referenced by both top-level apps.

However, there are some utility-type functions that are purely Javascript that I would like to reuse. There doesn’t appear to be a way to create a “WinMD” using Javascript (only C# or C++).

In a .NET world, I would usually just package whatever file as a resource and load it from a common assembly. Is there a way I could add a “common” .js file to a WinMD as a resource, and access it through some app-aware URL (i.e. ms-appx: or ms-resource: or something like that)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T00:36:28+00:00Added an answer on June 4, 2026 at 12:36 am

    The trick is as follows:

    1. Add the file you wish to reuse to a WinMD class library project (e.g. “MyWinMdProj”)
    2. Mark the resource as “content” in its property page (usually is by default)
    3. Add a reference to the class library from the top-level Metro app
    4. Use a script tag with the ms-appx protocol to reference the file, i.e.

    < script src=”ms-appx:///MyWinMdProj/path/to/file.js” >

    Note the three slashes; “MyWinMdProj” is a folder relative the Metro app’s package (i.e. ms-appx:///) as opposed to being its own top-level package.

    Note that any file included in this manner will be exposed on the filesystem under C:\Program Files\WindowsApps – but all of your html, js, css, etc. files from the top-level app project already are anyway, so you’re not any worse off in that regard than if you copied and pasted the code in between two (or more) different apps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

[SOLVED (see answer below)] I am using SpreadsheetWorker API to make working with Open
Problem solved: Thanks guys, see my answer below. I have a website running in
[EDIT: Problem solved. Please see my answer below.] In my app I call the
Update: Solved, with code I got it working, see my answer below for the
Edit: I have solved this by myself. See my answer below I have set
EDIT: This problem has been solved. See below. Hey all. I'm building an iPhone
Problem solved, see below Question I'm working in Flex Builder 3 and I have
(Problem solved now, see answers below) Hello, in my app I am trying to
Please see below function. -(void)loadHTMLinWebView { objWebView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
Problem Solved - See bottom for solution notes I'm trying to build a simple

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.