Andy
Andy

Reputation: 443

Creating your own library for use in window store dev (js) in visual studio

I am a javascript/html developer that hasn't ventured into visual studio much, so this might be a trivial question.

I am currently developing a Windows Store app (winJS), that will likely turn into several apps. And it would be highly likely that I will be reusing code, so I have made a js library with the common code.

The question is, how can I develop on this lib in visual studio, so that the apps that I am developing will use the latest version of it (i.e without me having to copy the files in again manually).

Best thing I can think of is, create a new project for the lib, and include it in the applications solutions, but what type of project would it have to be, and how to you expose the files?

Hope that makes sense!

Thanks!

Upvotes: 0

Views: 160

Answers (2)

Dominic Hopton
Dominic Hopton

Reputation: 7292

I usually solve this by having the project copy the JS files I want to a common location, and add that file to the target project using a LINK to the file I want to include, rather than just adding it -- this is on the "Add Existing File" dialog, under the little arrow on the "Add" button.

Upvotes: 3

Chris Tavares
Chris Tavares

Reputation: 30401

VS 2012 doesn't have a JavaScript library project type. You'll have to manage your library as loose files.

The easiest thing would probably be to create a nuget package. That way it would be easy to pull into other projects and have the tool help keep you up to date. It does have the downside of needing to put your stuff into a nuget feed, which is not something you want for private stuff.

Upvotes: 1

Related Questions