I just upgraded our projet to use Open RIA Services and I am having issues when building the solution on our TFS (online) build server. Looking at the errors, it seems that the client-side code generation is not working. Is there something I need to do to make it work?
NOTE: It is working locally...
Is your TFS server setup to restore NuGet and does it have a current version of NuGet installed? I have not tried doing a compile on a TFS build server myself, but NuGet is the first thing I would check.
Yes the server is configured to restore the NuGet packages. I have plenty of packages in my projets. :) As for the server itself, it is all managed by Microsoft and I do not have access to it.
There wasn't much information as to how we need to configure the NuGet packages for Open RIA. Maybe I did not add the reference to the right project? Right now, we have a lot of projects but we only have 1 project that is the RIA link, Do we need to add the NuGet reference to the Silverlight project or the server one?
The code generation is performed by the OpenRiaServices.Silverlight.Codegeneration NuGet package. The OpenRiaServices.Silverlight NuGet package includes the CodeGeneration package so, unless you manually installed the OpenRiaServices.Silverlight.Core package instead of OpenRiaServices.Silverlight you should have the correct packages installed.
All that being said, for the client code to generate a valid connection is needed to the SQL Server if you are using DbDomainService or LinqToEntitiesDomainService. Is your database on Azure or somewhere else where the TFS server can see it? Was the build working correctly with WCF RIA Services?
To respond to your question, yes it was working before with WCF Ria Services and yes, my database is in Azure and accessible.
Good news though, I fixed my issue. There is two things I did (not sure if both are required but I'll post them so that others can benefits from it).
1. I needed to add two .targets files in my source control. The first one is "packages\OpenRiaServices.Server.22.214.171.124\tools\OpenRiaServices.Validation.targets" and the second one is "packages\OpenRiaServices.Silverlight.CodeGen.126.96.36.199\build\OpenRiaServices.Silverlight.CodeGen.targets". I think this has something to do with the way the TFS build server reads the .targets in the solution/projects. There was a problem before (not sure if it has been fixed) that the .targets was read before the restore of the NuGet packages was done.
2. The project flagged as my Silverlight application is not the RIA linked project. I was adding the package for the code generation to only the RIA Linked project. I added the NuGet reference to my main Silverlight project.
Thank you again for your time! Keep up the good work! :)
Looking at the NuGet release notes, looks like that is something that NuGet fixed very recently (January 29th was the release date) so I am guessing that the TFS servers at Microsoft haven't updated yet.
Probably... This has been a pain for us for other packages.