4

I was working on Android app development and now I have switched to Windows Phone 8 app development, and have a problem.

I have 5 projects which have the same architecture (i.e. the UI and the code are exactly the same but only the data and app name are different). In Android what we had done is created a project and made that as library project and use this a Jar file and added to other apps.

Ex: CommonProject as library

Project 1

(a) Right-click on your project -> Properties

(b) In Android->Library section click Add CommonProject

You can refer to link : How to add a Library Project to a android project? for more details.

So now how can I achieve the same in Visual Studio 2012 (C#) for a Windows Phone 8 app?

Community
  • 1
  • 1
user2056563
  • 600
  • 2
  • 12
  • 37

2 Answers2

1

I think you can add a Project Reference, following that documentation :

In Solution Explorer, select the Web project that you want to add the project reference to.

On the Website menu (for Web site projects) or the Project menu (for Web application projects), choose Add Reference. Alternatively, you can right-click your Web project in Solution Explorer and then click Add Reference.

The Add Reference dialog box is displayed.

Click the Projects tab.

From the list of available projects, select the one to which you want to add a reference and then click OK.

The following are added to your Web project's Bin folder: A copy of the assembly created from the added project. Copies of dependent assemblies, XML document files, license files, resource files, and so on.

cubitouch
  • 1,929
  • 15
  • 28
  • It this is for web project or for windows phone 8 project, I am currently working on Windows Phone 8 app development. – user2056563 Jan 21 '14 at 14:48
  • It should work for any kind of project IMHO (but the project must be added in the solution). – cubitouch Jan 21 '14 at 14:49
  • See for a more classic point of view : http://msdn.microsoft.com/en-us/library/wkze6zky.aspx – cubitouch Jan 21 '14 at 14:51
  • Ok does this work as Overriding concept ? which I am looking for ?, like in future I need to override some properties can I do that ? – user2056563 Jan 21 '14 at 14:51
  • You can by the way use the main project as a library of component without handle manually the update of the reference. I'm not sure what you are referencing as "Overriding" concept. – cubitouch Jan 21 '14 at 15:02
1
  1. Right click on Solution
  2. Add -> New Project
  3. Select 'Windows Phone Class Library' under windows phone
  4. Click on OK new library will be added in your solution
  5. Add reference in your project by right click on References
  6. Go to solution select class library project.

May this will help you

Jaihind
  • 2,770
  • 1
  • 12
  • 19
  • Ok, I have created a 'Windows Phone Class Library' and added it as a reference to one of smaple project, in that I have MainPage.xaml and in 'Windows Phone Class Library' project also I have MainPage.xaml but its not showing the contents of 'Windows Phone Class Library' , why so ? – user2056563 Jan 21 '14 at 15:31