【问题标题】:Unable to Install Prism in Visual Studio 2013 Silverlight 5 Nevigation Application无法在 Visual Studio 2013 Silverlight 5 导航应用程序中安装 Prism
【发布时间】:2014-08-19 03:07:15
【问题描述】:

我正在尝试在 Visual Studio 2013 Professional 中安装 Prism。但得到以下错误

    Each package is licensed to you by its owner. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. Some packages may include dependencies which are governed by additional licenses. Follow the package source (feed) URL to determine any dependencies.

enter code here`Package Manager Console Host Version 2.8.50313.46

Type 'get-help NuGet' to see all available NuGet commands.

PM> Install-Package Prism
Attempting to resolve dependency 'Prism.Composition (≥ 5.0)'.
Attempting to resolve dependency 'CommonServiceLocator (≥ 1.2)'.
Attempting to resolve dependency 'Prism.Interactivity (≥ 5.0)'.
Attempting to resolve dependency 'Prism.PubSubEvents (≥ 1.0)'.
Attempting to resolve dependency 'Prism.Mvvm (≥ 1.0)'.
Installing 'CommonServiceLocator 1.2'.
Successfully installed 'CommonServiceLocator 1.2'.
Installing 'Prism.Composition 5.0.0'.
You are downloading Prism.Composition from Microsoft patterns & practices, the license agreement to which is available at http://compositewpf.codeplex.com/license. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'Prism.Composition 5.0.0'.
Installing 'Prism.Interactivity 5.0.0'.
You are downloading Prism.Interactivity from Microsoft patterns & practices, the license agreement to which is available at http://compositewpf.codeplex.com/license. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'Prism.Interactivity 5.0.0'.
Installing 'Prism.PubSubEvents 1.0.0'.
You are downloading Prism.PubSubEvents from Microsoft, the license agreement to which is available at http://prismwindowsruntime.codeplex.com/license. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'Prism.PubSubEvents 1.0.0'.
Installing 'Prism.Mvvm 1.0.0'.
You are downloading Prism.Mvvm from Microsoft patterns & practices, the license agreement to which is available at https://pnpmvvm.codeplex.com/license. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'Prism.Mvvm 1.0.0'.
Installing 'Prism 5.0.0'.
You are downloading Prism from Microsoft patterns & practices, the license agreement to which is available at http://compositewpf.codeplex.com/license. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'Prism 5.0.0'.
Adding 'CommonServiceLocator 1.2' to Hpmsprsim.Web.
Successfully added 'CommonServiceLocator 1.2' to Hpmsprsim.Web.
Adding 'Prism.Composition 5.0.0' to Hpmsprsim.Web.
Successfully added 'Prism.Composition 5.0.0' to Hpmsprsim.Web.
Adding 'Prism.Interactivity 5.0.0' to Hpmsprsim.Web.
Successfully added 'Prism.Interactivity 5.0.0' to Hpmsprsim.Web.
Adding 'Prism.PubSubEvents 1.0.0' to Hpmsprsim.Web.
Successfully added 'Prism.PubSubEvents 1.0.0' to Hpmsprsim.Web.
Adding 'Prism.Mvvm 1.0.0' to Hpmsprsim.Web.
Successfully added 'Prism.Mvvm 1.0.0' to Hpmsprsim.Web.
Adding 'Prism 5.0.0' to Hpmsprsim.Web.
Successfully added 'Prism 5.0.0' to Hpmsprsim.Web.

PM> Install-Package Prism
Attempting to resolve dependency 'Prism.Composition (≥ 5.0)'.
Attempting to resolve dependency 'CommonServiceLocator (≥ 1.2)'.
Attempting to resolve dependency 'Prism.Interactivity (≥ 5.0)'.
Attempting to resolve dependency 'Prism.PubSubEvents (≥ 1.0)'.
Attempting to resolve dependency 'Prism.Mvvm (≥ 1.0)'.
'Prism 5.0.0' already installed.
Adding 'CommonServiceLocator 1.2' to Hpmsprsim.
Successfully added 'CommonServiceLocator 1.2' to Hpmsprsim.
Adding 'Prism.Composition 5.0.0' to Hpmsprsim.
Install-Package : Could not install package 'Prism.Composition 5.0.0'. You are trying to install this
 package into a project that targets 'Silverlight,Version=v5.0', but the package does not contain any
 assembly references or content files that are compatible with that framework. For more information, 
contact the package author.
At line:1 char:16
+ Install-Package <<<<  Prism
    + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackage 
   Command

PM> 

我的系统中安装了 Silverlight 5。我在 VS2013 上创建了 1 个 silverlight 5 Nevigation Project。当我尝试通过 Nuget Package 在这个项目中安装 Prism 时,它给了我以下错误。 请指导我

【问题讨论】:

  • stackoverflow.com/questions/23256611/… sys 你不能用 4.5 安装所以我尝试了 4.5.1 仍然是同样的问题。所以我安装了我的 abstest.Web 项目,但我看到了除 Microsoft.Practice.Prism 之外的所有 Prism dll,它包含 M...Pr...Prism.Composite。随着它的安装,我尝试参考 abstest 项目。在添加期间,它说它是针对 Silverlight 构建的。这是否意味着 Silverlight 5 没有 Prism?
  • 当我下载 Prism 4.1 时,它允许我添加。它是可以工作的版本吗?

标签: telerik visual-studio-2013 prism silverlight-5.0


【解决方案1】:

Prism 5 与 Silverlight 5 不兼容,所以我使用 Prism 4.1。

我是怎么做到的?

我通过这些步骤创建了 Silverlight 5 应用程序。

  1. 创建文件夹 D/PrismTrial/Scr , D/PrismTrial/Libs ,D/PrismTrial/Scr/Modules ,D/PrismTrial/Scr/business
  2. 在库中复制 Prism 4.1 dll
  3. 在 Src 文件夹中创建 Silverlight 应用程序项目。提供 2 个 Project Abs 和 Abs.Web
  4. 为 Abs 项目提供 dll 参考

    Microsoft.Practices.Prism
    Microsoft.Practices.Prism.UnityExtensions
    Microsoft.Practices.Prism.Interactivity
    Microsoft.Practices.ServiceLocation
    Microsoft.Practices.Unity.Silverlight
    
  5. 创建一个 Bootstrapper.cs 类
  6. 删除 Main.xmal 并创建 Shell.xaml
  7. 在 D/PrismTrial/Scr/Modules 中创建模具,例如:Abs.Auth、Abs.TabTest
  8. 在 Bootstrapper 中加载了这些模块。
  9. 我测试的每一个步骤。它奏效了。

我关注了 http://www.silverlightshow.net/video/WCF-RIA-Services-Webinar-5.aspx 和一些来自 msdn 的 Prim 文档。 http://compositewpf.codeplex.com/ 错误从这里开始并使用 Prism 4.1 设置我的范围。

我很快就会将我的测试项目上传到某个开放的存储库。如果有任何免费存储空间,请告诉我。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-06-25
    • 1970-01-01
    • 1970-01-01
    • 2014-10-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多