Skip to main content
Home Forums Silverlight Programming Programming with .NET - General Silverlight, INotifyPropertyChanged, TeamBuild and WCF KnownType build issue!
1 replies. Latest Post by codebased on July 4, 2009.
(0)
MrLane
Member
0 points
2 Posts
07-03-2009 3:34 AM |
Hi All
I have encountered a very strange issue building our Silverlight / .NET3.5 solution using team build. We have a single solution with 2 solution folders, Server and Client. Client contains Silverlight projects, Server contains .NET 3.5 projects. We are using DataTransferObjects to send data from Services to the Silverlight front end over WCF using PollingDuplexHttpBinding.
All of these DTOs are WCF DataContracts, all inherit from a base class called DataObjectBase in the same Server side .NET 3.5 project called Server.DTOLibrary. The base class implements INotifyPropertyChanged as property changes to the DTOs are tracked.
On the Client Silverlight side there is a matching Silverlight project (Client.DTOLibrary) that contains file links to each of these DTOs and the base class (as we all know Silverlight cannot reference .NET projects).
Now a seperate pair of projects, again one Client Silverlight side and the other on the Server .NET 3.5 side, exist called Client.CommsLibrary and Server.CommsLibrary. Amongst WCF channel implementation these contain a class called DataReply which carries one DTO as a payload to the Silverlight Client. This class is implemented on the Server side and linked at the client side.
Now the important bit: The DataReply class has a property for carrying the DTO's as a payload of type DataObjectBase and each DTO type is referenced as a WCF KnownType.
This is totally fine building and running in the IDE. It is also fine building in MSBUILD at the command prompt. It will NOT build as part of an automated build (on 2 seperate Windows 2003 Servers) when built by team build (even though the servers WILL build using MSBUILD, but I have not tried it in the IDE of these boxes).
There is a build error is given for DataReply.cs on the client side stating that "INotifyPropertyChanged' is defined in an assembly that is not referenced. You must add a reference to assembly 'System, Version=2.0.0.0."
When the DTOs referenced as WCF KnownTypes are commented out, this error goes away. Remember that INotifyPropertyChanged is implemented by the DTO's base classed.
What makes this confusing is that we have other types that implement INotifyPropertyChanged linked on both Server and Silverlight side and we do not get this issue, it is only when done via KnownTypes...
Next week I am going to move the INotifyPropertyChanged out of the DataObjectBase class into the DTO's themselves and see what happens...but I dont see how this should matter...and doesnt explain the inconsistant building scenario with this only failing when done by team build...
Any ideas?
codebased
Participant
806 points
360 Posts
07-04-2009 5:32 AM |
I'd a similar problem but not same. I'd to uninstall Silverlight SDK at MSBuild server and install it again. I was using DataGrid release - 2008 one so I'd to manually install that on server.
rest works!