简体   繁体   English

如何从WCF RIA Service 1.0升级到SP2-Silverlight和实体框架

[英]How to upgrade from WCF RIA Service 1.0 to SP2 - Silverlight and Entity Framework

Can anyone provide a step by step guide for upgrading a VS2010 solution from RIA Services 1.0 + Silverlight 4 to RIA Services 1.0 SP2 + Silverlight 5? 谁能提供将VS2010解决方案从RIA Services 1.0 + Silverlight 4升级到RIA Services 1.0 SP2 + Silverlight 5的分步指南?

My solution is set up in the normal fashion: 我的解决方案是按常规方式设置的:

  1. MyApp.Web - ASP.NET Server project (entity framework here) MyApp.Web-ASP.NET Server项目(此处为实体框架)
  2. MyApp - Silverlight client project (RIA Services "connects" this with MyApp.Web) MyApp-Silverlight客户端项目(RIA Services将其“连接”到MyApp.Web)

Here is what I have so far: 这是我到目前为止的内容:

  1. Uninstall WCF RIA Services Toolkit and WCF RIA Services V1.0 for VS2010 卸载适用于VS2010的WCF RIA服务工具包和WCF RIA服务V1.0
  2. Install VS2010 SP1 安装VS2010 SP1
  3. Install Entity Framework 4.1 安装实体框架4.1
  4. Install Silverlight 5 Tools (contains RIA Services 1.0 SP2) 安装Silverlight 5工具(包含RIA Services 1.0 SP2)

Here is where I am lost. 这是我迷路的地方。 What do I do next? 接下来我该怎么办? In particular: 尤其是:

  1. What project references do I need to remove/add from my client and server projects? 我需要从客户端和服务器项目中删除/添加哪些项目引用?
    1. to go from Entity Framework 4.0 to 4.1 从Entity Framework 4.0转到4.1
    2. to go from RIA Services 1.0 to RIA Services 1.0 SP2 从RIA Services 1.0到RIA Services 1.0 SP2
    3. to go from Silverlight 4 to 5 从Silverlight 4转到5
  2. Anything else I am missing? 我还有什么想念的吗?
  3. What do I need to do on my production server (running Win XP) where my solution is deployed to? 在将解决方案部署到的生产服务器(运行Win XP)上,我需要做什么?
    1. I remember installing .NET Framework 4.0 and RIA Services distributable (awhile back) 我记得安装了.NET Framework 4.0和RIA可分发的服务(前一段时间)

Thanks in advanced. 提前致谢。

1.1 When I start a new Project and add a ADO.NET Entity Data Model it automatically adds the following assemblies: 1.1当我启动一个新项目并添加ADO.NET实体数据模型时,它会自动添加以下程序集:

System.Data.Entity
System.Runtime.Serialization
System.Security

So I would remove them from the Project and add them again just to make sure using the highest version. 因此,我将其从项目中删除,然后再次添加它们,以确保使用最高版本。

1.2 There can be only one version of Ria on your machine. 1.2您的计算机上只能有一个Ria版本。 So your project automatically uses the last installed version. 因此,您的项目会自动使用上次安装的版本。

1.3 Go to the Properties page of your Silverlight Project and open the Tab 'Silverlight'. 1.3转到Silverlight项目的“属性”页面,然后打开“ Silverlight”选项卡。 Change the version to Silverlight 5 under Target Silverlight Version: Important note: If you have a large project this will take very VERY long to complete. 在“ 目标Silverlight版本:目标”下将版本更改为Silverlight 5 重要说明:如果您有大型项目,则需要很长时间才能完成。 Make yourself some coffee and wait. 给自己喝杯咖啡,然后等待。 The UI can become unresponsive when changing it, however don't touch it. 更改时,UI可能会变得无响应,但是请不要触摸它。 Even when you loose your patience. 即使您失去耐心。 If you do abort than there will probably remain some faults in your .csproject file. 如果您中止操作,则.csproject文件中可能还会存在一些故障。

First point 3: Install the Silverlight 5 Tools also on your server along with the Entity FrameWork 4.1 this way it won't matter if your forgetting to set Copy Local to True for a new Silverlight assembly. 第3点:还将Entity FrameWork 4.1和服务器上的Silverlight 5 Tools一起安装在服务器上,这样就不必忘记为新的Silverlight程序集Copy Local设置为True了。 ( Which means you won't have to republish again if you forgot. ) (这意味着,如果您忘记了,则不必重新发布。)

Point 2: Make sure your project works with the new installed versions by checking/doing the following things: - Remove the bin and obj folders in both projects. 要点2:通过检查/执行以下操作,确保您的项目与新安装的版本兼容:-删除两个项目中的bin和obj文件夹。
- Remove the hidden GenerateCode folder in your Silverlight Project. -删除Silverlight项目中隐藏的GenerateCode文件夹。
- Make sure your own referenced assemblies are also targeting Silverlight 5. -确保您自己引用的程序集也针对Silverlight 5。
- After ReBuilding when doing all of this I would do something that looks odd but has proven to solve stupid errors: In the properties page of your Silverlight project disable the WCF Ria Services link by setting it to <No Project Set> Build your project (resulting in a lot of errors, I know) Switch the link back and rebuild. -完成所有这些操作后,在重新构建后,我会做一些看起来很奇怪但已证明可以解决愚蠢错误的操作:在Silverlight项目的属性页中,将WCF Ria Services link设置为<No Project Set>来禁用WCF Ria Services link 。导致出现很多错误,我知道)切换回链接并重建。 Remember that Ria supports Complex-Object Serialization since SP1 which they wanted to be there from the first version but couldn't finish it in time. 请记住,Ria从SP1开始支持复杂对象序列化,他们希望从第一个版本开始就可以使用该对象,但是无法及时完成。 This can give you a headache if you included assemblies to the silverlight client that includes object types also existent on the server side. 如果您在Silverlight客户端中包含了包含服务器端也存在的对象类型的程序集,这可能会让您头疼。

Good luck and if you get any troubles than just ask. 祝你好运,如果您遇到任何麻烦,不只是问问。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM