如何让WCF RIA服务类库以.NET Framework 4.5为目标? [英] How can I get the WCF RIA Services Class Library to target the .NET Framework 4.5?
问题描述
您好先生,
我有这个问题让我永远想通了。每当我尝试将新的WCF RIA服务类库添加到Silverlight应用程序时,即使我为新的WCF RIA服务类库选择了.NET Framework 4.5,VS2012仍会要求选择要为应用程序定位的Windows Phone平台。在我使用Windows Phone的小型应用程序之后,就会发生这种情况。
如何让WCF RIA服务类库以.NET Framework 4.5为目标?
我遵循的流程是:
1.-创建一个新的Silverlight应用程序
2.-添加新项目:WCF RIA服务类库(从Silverlight模板顶部的下拉列表中选择.NET Framework 4.5)
3.-下一个窗口显示的标题为新Windows Phone应用程序,它显示消息选择要为此应用程序定位的Windows Phone平台,并在消息下方有一个包含2个选项的下拉列表:Windows Phone OS 7.1和Windows Phone OS 8.0
提前致谢。
祝你好运,
Luis Nambiar
Hello Sirs,
I have this issue that is taking me forever to figure out. Whenever I try to add a new WCF RIA Services Class Library to a Silverlight application, VS2012 asks to select the Windows Phone Platform to target for the application even though I selected ".NET Framework 4.5" for the new WCF RIA Services Class Library. This is happening after I worked on a small application for Windows Phone.
How can I get the WCF RIA Services Class Library to target the .NET Framework 4.5?
The process I am following is:
1.- Create a new Silverlight application
2.- Add new project: WCF RIA Services Class Library (.NET Framework 4.5 is selected from the drop down list on top of the Silverlight templates)
3.- The next window shown has as a title "New Windows Phone Application" and it has the message "Select the Windows Phone Platform you want to target for this application" and below the message there is a drop down list with 2 options: "Windows Phone OS 7.1" and "Windows Phone OS 8.0"
Thanks in advance.
Best regards,
Luis Nambiar
推荐答案
Silverlight和.NET使用完全不同的运行时,不能混用。 RIA服务(客户端)库无法定位正确的.NET框架。
这就是RIA Services首先在客户端库中自动生成的全部原因:因为无法共享服务器端实体。
Silverlight and .NET use entirely different runtimes and cannot be mixed. A RIA Services (client) library cannot target the proper .NET framework.
That's the whole reason why RIA Services auto-generates classed in a client library in the first place: Because the server-side entities cannot be shared.
这篇关于如何让WCF RIA服务类库以.NET Framework 4.5为目标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!