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

查看:76
本文介绍了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="..\Path\Your.Hosting.Project\Your.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="..\Path\Your.Hosting.Project\Your.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天全站免登陆