views:

92

answers:

2

I tried out to create a little test application.

My goal is to access to a database with a wcf service, have class library for data objects and use this library for the ASP.Net webpage and for the Windows Phone 7.

Is this possible? My current problem is to create a library which I can use for WP7 and my WCF service. It's not possible to reference a C# class library to a WP7 application and it's not possible to reference a WP7 Silverlight library to my WCF service.

What's the best way to go. I will avoid to programm code twice for my ASP.Net webpage and for the WP7 app.

Thanks for hints.

Cheers Andy

A: 

Create 2 separate libraries but share the source between the two. Create the first library, then in the second library add an existing file. On the Add button, click the little down arrow and select 'Add As Link'.

This will allow you to create 2 libraries with their own dependencies/references. You will have to be aware of the namespaces you use in your code and what is available on each platform as not all will be available in both.

Matt Lacey
A: 

Thanks Matt

That is exactly what I tried after I wrote this post. ;-) It works very well

Andy