使用RIA服务而不是Visual Studio时,MsBuild会生成不同的客户端代理代码. [英] MsBuild generating different client side proxy code when using RIA services as opposed to Visual Studio.

查看:87
本文介绍了使用RIA服务而不是Visual Studio时,MsBuild会生成不同的客户端代理代码.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我最初在silverlight.net论坛上发表了这篇文章,因为我最初认为这可能是RIA服务的问题:http://forums.silverlight.net/t/247888.aspx/1?Msbuild+ignoring+build +订单+何时+使用+ RIA +服务

Firstly I started this post on the silverlight.net forum as I orginally thought it may be a problem with RIA services: http://forums.silverlight.net/t/247888.aspx/1?Msbuild+ignoring+build+order+when+using+RIA+services

基本上,在我的解决方案中,我利用了RIA Services 1.0 SP2中引入的在不同项目中跨多个域服务共享实体的功能.这允许我做的是其他领域的参考项目 服务器上的服务,但至关重要的是,它只能在一个使用中的项目中生成客户端代理代码.然后,我在适当的DomainContext上调用AddReference,以从其他域上下文中加载任何外部实体.

Basically in my solution I am taking advantage of the ability to share entities accross multiple domain services in different projects that I think was introduced in RIA Services 1.0 SP2.  What this allows me to do is reference projects with other domain services on the server but then crucially only generate client side proxy code in a single consuming project.  I then call AddReference on the appropiate DomainContext to load in any external entities from other domain contexts.

据我了解,关键部分是确保在服务器端复制服务器端域服务之间的所有引用,这样做是因为RIA允许RIA仅在一个位置生成代理代码.可以弄清楚 哪些实体等被共享.

From what I have learnt the key part to this is making sure that any references between domain services on the server side are replicated on the client side, doing this is what allows RIA to only generate the proxy code in one location as it can figure out which entities etc are shared.

这一切在Visual Studio中都可以正常工作,但是当我使用MSbuild构建代码时,会生成不同的生成代码,并且似乎共享实体被忽略,并且在多个位置生成了多个代理.然后,这导致构建 错误的引用.

This all works fine in visual studio, however when I use MSbuild to build the code different generated code is genertated and it seems like shared entities are ignored and multiple proxys are generated in multiple locations.  This then causes build errors with ambiguous references.

现在,我知道MSBuild 4.0存在一个已记录的问题,如果它似乎忽略了具有RIA链接的客户端和服务器项目之间的依赖关系.解决方法是将.sln文件排序到Visual Studio认为正确的文件 过去有效的订单.我已经做到了,但仍然没有喜悦(我也不知道这是不是鲱鱼).当我查看构建日志时,解决方案似乎是按照正确的顺序构建的.我也相信这个问题已经解决 在MSbuild 4.5中,我下载了开发人员预览版,但与此版本也看到了相同的问题.

Now I know that there is a documented issue with MSBuild 4.0 were it seems to ignore the dependancy between a client and server project which have RIA link.  The workaround has been to order the .sln file to what visual studio thinks is the correct order which has worked in the past.  I have done this but still no joy (also I'm not sure if this is a red herring).  When I review the build log the solution does seem to be building in the correct order.  I also believe this issue is fixed in MSbuild 4.5, I downloaded the developer preview but I see the same issue with this version too.

现在,我的解决方案涉及120多个大型项目,我们有几个域服务,这只是其中几个问题,因此,我认为在这几个项目中我必须做些不同的事情.但是我已经比较了一切 我可以想到的(项目文件,域服务,实体和属性,当共享的实体被共享并且存在属性时),但是没有明显的突出之处.因此,我希望有人可以为我提供MSbuild在决定时使用的逻辑的定义 生成什么代理代码.然后希望借助这些信息,我将能够发现差异!如果有人有其他建议,请告诉我.

Now my solution is quite large 120+ projects and we have several domain services and this is only an issue in a couple of them, therefore I think there must be something I am doing different in these select few projects.  However I have compared everything I can think of (project file, domain service, entities and attributes, when shared entities are shared and there attributes) but nothing obvious stands out.  So I am hoping someone could provide me with a defintion of the logic MSbuild uses when deciding what proxy code to generate.  Then with this information hopefully I will be able to spot the difference!  If people have any other suggestions please let me know.

谢谢

Phil

推荐答案

Hello,

谢谢您的问题.

Thank you for your question.

我是试图让熟悉此主题的人进一步研究此问题.可能会有一些时间延迟.感谢您的耐心.

谢谢为您的理解和支持.

Yi


这篇关于使用RIA服务而不是Visual Studio时,MsBuild会生成不同的客户端代理代码.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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