在 Visual Studio 中安装 Prism 时出错 [英] Errors with installing Prism in visual studio

查看:64
本文介绍了在 Visual Studio 中安装 Prism 时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Visual Studio 2013 中的通用 Windows 手机/Windows 8.1 应用程序中使用 Microsoft.Practices.Prism 库.第一天效果很好.今天,当我登录我的构建时会失败,因为它声称它没有对 Microsoft.Practices 的引用,但是智能感知会同时获取 Microsoft.Practices 和 Microsoft.Practices.Prism.所以我使用nuget包管理器卸载了Prism,然后重新安装了它.现在我收到此错误.

I am attempting to use the Microsoft.Practices.Prism library in a universal windows phone/windows 8.1 app in Visual studio 2013. It was working great for the first day. Today when I logged in my build would fail because it claimed it did not have a reference to Microsoft.Practices, however intellisense would pick up both Microsoft.Practices and Microsoft.Practices.Prism. So I uninstalled Prism using nuget package manager, then reinstalled it. Now I am getting this error.

我看到帖子声称更新 nuget 解决了这个问题,但我有最新版本(我卸载了 nuget 并重新安装)

I have seen posts claiming that updating nuget solved this issue but I have the most recent version (I uninstalled nuget and reinstalled)

只是为了澄清 prism 确实支持 4.5 所以这个错误并不是真的很有道理

Just for clarification prism does support 4.5 so this error does not really make much sense

推荐答案

NuGet 不允许您将 NuGet 包安装到针对 NuGet 包中未包含的 .NET 框架的项目中.

NuGet will not let you install a NuGet package into a project that is targeting a .NET framework which is not included in the NuGet package.

您的项目面向 Windows 8/Windows 应用商店 (.NETCore).Prism.Composition NuGet 包有一个完整的 .NET Framework 程序集.NuGet 认为这些不兼容,这就是您收到错误的原因.Prism NuGet 包可能正在使用完整的 .NET Framework 的一部分,这些部分不适用于 Windows Store 应用程序,这就是 NuGet 失败的原因.

Your project is targeting Windows 8/Windows Store (.NETCore). The Prism.Composition NuGet package has an assembly for the full .NET Framework. NuGet considers these to not be compatible which is why you are getting the error. The Prism NuGet package may be using parts of the full .NET Framework which are not available to a Windows Store application which is why NuGet is failing.

版本号不是问题.如果您的项目面向完整的 .NET Framework 4.5.1,那么您可以安装 Prism.Composition,它具有完整的 .NET Framework 4.5 程序集.

The version number is not the problem. If your project was targeting the full .NET Framework 4.5.1 then you could install Prism.Composition which has an assembly for the full .NET Framework 4.5.

为了将 NuGet 包安装到 Windows 应用商店项目中,它需要明确面向 Windows 8 或包含兼容的可移植类库 (PCL).

In order to install a NuGet package into a Windows Store project it would need to explicitly target Windows 8 or include a Portable Class Library (PCL) which is compatible.

您可以使用几个 Prism NuGet 包,其中包含 PCL相反.

There are a couple of Prism NuGet packages that contain PCLs that you might be able use instead.

这篇关于在 Visual Studio 中安装 Prism 时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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