Silverlight 4、RIA 服务和TFS 2010 构建服务器 [英] Silverlight 4, RIA Services & TFS 2010 Build Server

查看:26
本文介绍了Silverlight 4、RIA 服务和TFS 2010 构建服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Visual Studio 2010 解决方案文件,其中包含许多项目.Silverlight 项目(作为模块)、Silverlight Shell 项目和许多 RIA 服务混合使用.

I have a Visual Studio 2010 solution file with a number of projects in it. There is a mix of Silverlight projects (acting as modules), the Silverlight Shell project and a number of RIA services.

在使用 TFS 2010 执行构建时,总是失败,因为 RIA 服务生成的代理类尚未先构建.到目前为止,我看到的唯一解决方案是在我的 .sln 文件中手动更改构建顺序.不,谢谢,有很多项目.

When using TFS 2010 to perform the build, it always fails because the proxy classes generated by the RIA services have not been built first. The only solution I have seen so far is to manually change the build order in my .sln file. No thanks, there are loads of projects.

与其将解决方案分解为客户端和服务器端解决方案,不如找到一个更好的解决方案.

Rather than break the solution up in to client side and server side solution, I'd like to find a better solution.

显然 MSBuild 4 忽略了 .sln 文件中的构建顺序.

Apparently MSBuild 4 ignores the build order in the .sln file.

有人有任何想法/建议吗?

Does anyone have any ideas/suggestions?

谢谢,

推荐答案

我发现的最简单的方法是明确声明 Silverlight 项目和托管 RIA 服务的项目之间的依赖关系.

The simplest way I've found is to declare explicitly the dependency between Silverlight project and the project that is hosting RIA service.

您必须在文本编辑器中打开您的 Silverlight 项目文件并向其中添加一个片段:

You have to open in a text editor your Silverlight project file and add a fragment to it:

<ItemGroup>
  <ProjectReference Include="..PathYour.Hosting.ProjectYour.Hosting.Project.csproj">
    <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
  </ProjectReference>
</ItemGroup>

这将告诉 msbuild 在构建您的 Silverlight 应用程序之前构建您的 Web 服务.并且只有在使用 msbuild 构建时才有效,VS 会抛出错误.

This will tell msbuild to build your web service before building your Silverlight app. And it will work only when building with msbuild, VS will throw an error.

要在 Visual Studio 中也构建它,您必须将此片段包装在一个 Target 中并将其添加到 Project 节点中的 InitialTargets:

To get it built in Visual Studio also, you have to wrap this fragment in a Target and add it to InitialTargets in Project node:

<Target Name="MySpecialReferences">
  <ItemGroup>
    <ProjectReference Include="..PathYour.Hosting.ProjectYour.Hosting.Project.csproj">
      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
    </ProjectReference>
  </ItemGroup>
</Target>

<Project ... InitialTargets="MySpecialReferences" ... >

Visual Studio 2010 现在将跳过此目标,但 msbuild 将用于更改项目的构建顺序.

Visual Studio 2010 will skip this target now but msbuild will use to change built order of projects.

这篇关于Silverlight 4、RIA 服务和TFS 2010 构建服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆