Good day. I try to build Windows And WP7 Applications, using one WCF service. For greater convenience i want to define all my contracts and interfaces in one common library. But, since WP7 project cant reference to Win-library i create a WP7 Class Library and in him i create next class:
[ServiceContract]
public interface IStubSrv
{
[OperationContract]
void Foo1();
[OperationContract]
void Foo2();
}
But i have next problem: when i add reference in Win-Project to this library in runtime i get next exception:
Could not load file or assembly 'System.ServiceModel, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
If i remove reference to System.ServiceModel from my common library - i can add reference to my library in Win-Project, but i cant use ServiceContract and DataContract attributes, and than CLR cant use this library via WCF.
So my directly question: can i create common library whith definition WCF-contracts, which can be used by WCF-infrastructure, Windows Application and WP7 Application? Or i must create two different assembly with exactly the same code??