Missing [RoundtripOriginal()] in RIA Service auto-generated code

Recently after upgrading to latest Telerik binaries in my Silverlight RIA Service application, I noticed a different behavior in the auto generated code. After searching a lot on the issue, came to know that the RoundtripOriginalAttribute was missing in the entity set.


As we can not add the attribute explicitly in a auto generated file, I had a tough time to find out the solution of this issue. Lately, got the solution which I am going to document it here for you.



If you are already working in Silverlight and RIA Services, you might already know that, there is an auto generated file called “PROJECT_NAME.Web.g.cs” inside the “Generated_Code” folder under your Silverlight client project. The file automatically gets created on every build.


The entities present in this file has an attribute called “RoundtripOriginalAttribute” (most of the cases), but after upgrading to latest Telerik binary version I noticed that the said attribute was automatically removed from the file with the following comment:

“The following attributes were not generated: The attribute ‘System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute’ is not visible in the client project ‘PROJECT_NAME’. Are you missing an assembly reference?”

RoundtripOriginalAttribute missing from the RIA Service entity


Actually, the issue was not due to Telerik binaries but a different System binary that RIA Service uses. In my scenario, the latest Telerik.Windows.Controls.ScheduleView.dll assembly is using Telerik.Windows.Control.dll, which again internally uses System.Windows.dll. After adding them one-by-one, my application started misbehaving.


First I thought, it’s due to the assemblies that I updated recently but later I was sure that, it should not be due to the Telerik assemblies that I have upgraded. After doing a hell lot of analysis, found that the System.Windows.dll that I added to the project was causing the issue.



So, what’s the issue? After doing a couple more analysis, I noticed that my System.Windows.dll has the “Copy Local” attribute set to “True” as shown below:


System.Windows.dll has CopyLocal attribute set to True


Just to follow a trial and error method to resolve the issue, I changed it to “False”. You won’t believe that just this small change bring back the “RoundtripOriginalAttribute” to the entities in the WCF RIA Service’s auto generated code file and everything started working properly.


Here is how the attribute “Copy Local” will look for System.Windows.dll assembly reference with the value “False”:


Set System.Windows.dll CopyLocal attribute to False


And when I rebuild the project, I got the [RoundtripOriginal] attribute set to the key properties of the entity set as stated in the below screenshot:

Generated DomainService of RIA Services with RoundtripOriginalAttribute in the entity set


Not a big deal but finding out the solution was hectic. I spent a big amount of time just to find the issue and the online forum answers didn’t give me a valid result. Thus thought to share the same here, in case you face the same issue, this will help you to resolve the problem quickly by just following the above simple step.


There is a proverb “Nothing is impossible in the world and the word ‘IMPOSSIBLE’ itself says ‘I M Possible’” and this is true. I hope that this post was as useful as my other blog posts and will help you to resolve the RoundtripOriginal attribute issue in your WCF RIA Services project. Let me know, if that helps.

If you have come this far, it means that you liked what you are reading. Why not reach little more and connect with me directly on Twitter , Facebook , Google+ and LinkedIn . I would love to hear your thoughts and opinions on my articles directly. Also, don't forget to share your views and/or feedback in the comment section below.


  1. I'm curious. What version of Ria Services chews up the RoundTripOriginal()? In any case, are you regenerating the metadata file?

  2. The RIA Services dlls are compiled against Silverlight 4, not Silverlight 5, so it is possible that having the Silverlight 5 System.Windows.dll copied locally was causing problems. Open RIA Services will be compiled against Silverlight 5 so that may take care of the problem.

    1. Thanks Colin for the clarification. Yes, that could be the issue behind all these. BTW, when are you releasing the first version of open RIA Services?


© 2008-2016 Kunal-Chowdhury.com - Microsoft Technology Blog for developers and consumers | Designed by Kunal Chowdhury
Back to top