Silverlight 4 + WCF RIA 服务 + Prism v4 为什么我的 shell 需要模块依赖?

发布于 2024-12-03 02:10:30 字数 1706 浏览 0 评论 0 原文

我正在尝试创建一个 WCF RIA Services + Prism v4 应用程序,其中项目的布局如下:

客户端

模块(目前只有一个):

Project.Modules .Clients(包含指向我的 Project.Web 应用程序的 WCF RIA 服务链接,并依赖于服务器端 Project.Web 项目)

Shell 项目

Project.Shell(包含指向我的 Project.Web 的 WCF RIA 服务链接)应用和依赖在 Project.Modules.Client 模块和 Project.Web 项目上。还包含我继承的 UnityBootstrapper 中使用的模块目录 XAML 文件)

服务器端

主 Web 项目

Project.Web (包含我的 WCF RIA 服务、DataModel 等)

问题

为什么我需要从我的 shell 项目引用模块项目?这是否本质上违背了动态模块初始化的目的?我尝试遵循几个示例项目和博客文章,包括:

http://telecosystems.codeplex.com

以及随附的博客文章:

http://bachelorthesis.zdechovan.com/prism-solution-based-on-the-business-application-template/

以及 David 的 MSDN 博客文章:

http://blogs.msdn.com/b/dphill/archive/2009/08/17/prism-and-net-ria-services.aspx

如果我不这样做会发生什么包含引用是一个例外,如下所示:

Resolution of the dependency failed, type = "Project.Modules.Clients.ClientsModule", name = "(none)". Exception occurred while: while resolving. Exception is: InvalidOperationException - The current type, Microsoft.Practices.Prism.Regions.IRegionManager, is an interface and cannot be constructed. Are you missing a type mapping?

很明显,Unity 似乎无法识别该模块,尽管我已经三重检查了我的引导程序和模块目录文件。

如果有人指出我可能做错了什么,需要从我的 shell 重新引用我的模块,我将不胜感激。

谢谢。

I am trying to create a WCF RIA Services + Prism v4 application in which the projects are laid out like so:

Client Side

Modules (only one for now):

Project.Modules.Clients (Contains a WCF RIA services link to my Project.Web application and depends on server-side Project.Web project)

Shell Project

Project.Shell (Contains a WCF RIA services link to my Project.Web application and depends on the Project.Modules.Client module and the Project.Web project. Also contains the module catalog XAML file used in my inherited UnityBootstrapper)

Server Side

Main Web Project

Project.Web (Containing my WCF RIA services, DataModel, etc.)

The Question

Why do I need to reference the module projects from my shell project? Doesn't this essentially defeat the purpose of dynamic module initialization? I've attempted following along with several sample projects and blog posts, including:

http://telecosystems.codeplex.com

and the accompanying blog post here:

http://bachelorthesis.zdechovan.com/prism-solution-based-on-the-business-application-template/

as well as David's MSDN blog post here:

http://blogs.msdn.com/b/dphill/archive/2009/08/17/prism-and-net-ria-services.aspx

What happens when I don't include the reference is an exception like so:

Resolution of the dependency failed, type = "Project.Modules.Clients.ClientsModule", name = "(none)". Exception occurred while: while resolving. Exception is: InvalidOperationException - The current type, Microsoft.Practices.Prism.Regions.IRegionManager, is an interface and cannot be constructed. Are you missing a type mapping?

So obviously Unity can't seem to pick up on the module, though I've triple checked my bootstrapper and module catalog file.

Any pointers on what I might be doing wrong to require such a reference back to my modules from my shell would be greatly appreciated.

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

人海汹涌 2024-12-10 02:10:30

你是对的,问题涉及我的 .xap 文件。一些我的 Web 应用程序的 Silverlight 项目链接如何失效并弄乱一切的情况。

一旦我修复了链接,这就解决了我的所有问题。

You are correct, the issue involved my .xap files. Some how my Web application's Silverlight project links got borked and messed everything up.

Once I remediated the links, this fixed all of my issues.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文