none
Building RIA services project without Visual Studio

    Question

  • Hi All,

    I'm trying to build RIA-enabled Silverlight project on the continuous integration server. There is no Visual Studio installed on it. Therefore I'm missing some libraries/targets.

    What needs to be installed in order to build RIA project with only MSBuild?

    Thanx.

    Wednesday, September 08, 2010 8:28 AM

Answers

  • Not really obvious but:

    1. Install Ria Services: msiexec /i RiaServices.msi SERVER=TRUE
    2. Copy C:\Program Files\Microsoft SDKs\RIA Services\v1.0\Libraries\Server\Microsoft.ServiceModel.DomainServices.Tools.dll from dev machine where Visual Studio is installed (since SERVER=TRUE does not install this assembly).
    3. Remove (rename) C:\Program Files\MSBuild\Microsoft\Silverlight\v4.0\Microsoft.VisualStudio.ServiceModel.targets

    After that I managed to build it without Visual Studio.

    Monday, September 13, 2010 4:59 AM

All replies

  • Can you install Visual Studio? That's the simplest solution. You won't use it to build, but it takes care of all the dependencies. 

    Wednesday, September 08, 2010 6:55 PM
  • I want a bit more tricky solution =)

    It should exist since code gen is actually done by MSBuild task. It seems that in this thread they found the solution but it doesn't work for me. And I was not able to contact meteorrr to check with him.

    Thursday, September 09, 2010 2:40 AM
  • You could try copying all the RIA assemblies and gac-ing the server ones.

    Thursday, September 09, 2010 12:02 PM
  • Not really obvious but:

    1. Install Ria Services: msiexec /i RiaServices.msi SERVER=TRUE
    2. Copy C:\Program Files\Microsoft SDKs\RIA Services\v1.0\Libraries\Server\Microsoft.ServiceModel.DomainServices.Tools.dll from dev machine where Visual Studio is installed (since SERVER=TRUE does not install this assembly).
    3. Remove (rename) C:\Program Files\MSBuild\Microsoft\Silverlight\v4.0\Microsoft.VisualStudio.ServiceModel.targets

    After that I managed to build it without Visual Studio.

    Monday, September 13, 2010 4:59 AM
  • This worked for me - thank you VERY much X-Cray. 

    Monday, September 13, 2010 5:02 PM
  • Using Jeff Wilcox's Building Silverlight 3 and Silverlight 4 applications on a .NET 3.5 build machine post as a reference, I was able to get a SilverLight 4 + RIA Services solution building properly on a TFS Build Server without installing Visual Studio, SilverLight, or RIA Services on the server.  After getting the SilverLight 4 bits added to source control in a relative location in the build's workspace as Jeff prescribes, I took the following additional steps to support the compile time generation of the xap output.

    Add RIA Services bits alongside SilverLight 4 in source control

    • Copy the contents of %programfiles%\Microsoft SDKs\RIA Services\v1.0\Libraries\Server into your new SilverlightBuildResources location (alongside the .targets).
    • Copy the contents of %programfiles%\Microsoft SDKs\RIA Services\v1.0\Libraries\Silverlight into your new TargetFrameworkSDKDirectory ($(SilverlightBuildResources)Libraries\Client\).

    Customize the RIA <Import /> targets and <UsingTask /> references

    • Microsoft.Silverlight.Common.targets:
      • <Import Project="Microsoft.Ria.Client.targets" Condition="Exists('Microsoft.Ria.Client.targets')"/>
    • Microsoft.Ria.Client.targets::
      • <Import Project="Microsoft.Ria.Client.VisualStudio.targets" Condition="Exists('Microsoft.Ria.Client.VisualStudio.targets')"/>
      • <UsingTask TaskName="Microsoft.ServiceModel.DomainServices.Tools.CreateRiaClientFilesTask" AssemblyFile="Microsoft.ServiceModel.DomainServices.Tools.dll" />
      • <UsingTask TaskName="Microsoft.ServiceModel.DomainServices.Tools.CleanRiaClientFilesTask" AssemblyFile="Microsoft.ServiceModel.DomainServices.Tools.dll" />

    Note: It would be much simpler to just install Visual Studio on the build server if that is an option for you.  But, this method has certain advantages I hope someone other than myself finds useful.

    Thursday, June 09, 2011 12:34 PM
  • this is such an annoying error.

    None of these solutions work for me.

    I'm using just msbuild (no TFS).

    No matter how I modify the targets files, I still get the same error:

    • C:\Program Files\MSBuild\Microsoft\Silverlight\v4.0\Microsoft.Ria.Client.targets(304,5): error MSB4062: The "Microsoft.ServiceModel.DomainServices.Tools.CreateRiaClientFilesTask" task could not be loaded from the assembly Microsoft.ServiceModel.DomainServices.Tools.dll. Could not load file or assembly 'Microsoft.ServiceModel.DomainServices.Tools.dll' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [E:\Build\SLProj\src2\SLProj.Client.Common\SLProj.Client.Common.csproj]

    Looking at Wilcox's post, it doesn't seem there is anything special being done to force the references to be loaded from a given directory. I've tried copying the DLLs beside the targets, beside the .sln and .csproj, in the obj/bin directories, etc .. nothing works. I hoped that by simply copying the directories with the dlls/targets/etc (everything needed for MSBuild to do the compilation, or so I thought) from my dev machine with VS2010 installed i wouldn't have to fuddle with tricking anything into looking in a local directory ... but clearly that isn't working.

    What am I missing? Or better yet .. why can't there be a flawless guide to doing this published somewhere?
    uggh. Cry

    Friday, January 27, 2012 5:09 PM
  • Not really obvious but:

    1. Install Ria Services: msiexec /i RiaServices.msi SERVER=TRUE
    2. Copy C:\Program Files\Microsoft SDKs\RIA Services\v1.0\Libraries\Server\Microsoft.ServiceModel.DomainServices.Tools.dll from dev machine where Visual Studio is installed (since SERVER=TRUE does not install this assembly).
    3. Remove (rename) C:\Program Files\MSBuild\Microsoft\Silverlight\v4.0\Microsoft.VisualStudio.ServiceModel.targets

    After that I managed to build it without Visual Studio.

    Agreed with X-Cray

    Saturday, January 28, 2012 7:26 AM
  • I tried all that. Copying .domainservices.tools was not enough - had to gacutil it with tha gacutil version from netfxtools\ in the win 7sdk.

    Deleting the various targets also caused other problems.

    I have another thread since this you guys have solved your issue

    http://social.msdn.microsoft.com/Forums/en-US/silverlightnet/thread/84c9a494-38f4-4743-b66d-9b547f85ced1//1?Silverlight+RIA+Services+automated+build+

    Saturday, January 28, 2012 11:17 AM