Scenario
Problem
On the server side, we have generated entity objects using Entity Framework model. We have used self tracking T4 templates to generate the entities. These entities are shared and can be used from the client side (Silverlight 4 project).
But when we try to add a new Web Service reference, the proxy generator don't work. The reference.cs file is empty. We have checked the option 'Reuse Types' in the configuration of the Web Reference. We have checked the assemblies that will be shared (entity assemblies only).
We have tried to remove every (IsReference=true) from DataContract attributes of the entities but it did not work.
Any idea or workaround?
Unchecking the "Reuse Types" worked for me. The code generator walks the object graph of dependencies and if it encounters any problem, like a reference not found, then it blows up and doesn't produce any code in the reference.cs.
This can occur when the assembly your are trying to share is compiled against a higher .NET platform.
For example if your project is targeting .NET 3.5 and the assembly is compiled against 4.0 this will happen.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With