您的项目未引用“.NETFramework,Version=v4.5";框架.

Your project is not referencing the quot;.NETFramework,Version=v4.5quot; framework.(您的项目未引用“.NETFramework,Version=v4.5;框架.)
本文介绍了您的项目未引用“.NETFramework,Version=v4.5";框架.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 VS 2015.

<块引用>

您的项目未引用.NETFramework,Version=4.5"框架.在中添加对.NETFramework,Version=4.5"的引用project.json 的框架"部分,然后重新运行 NuGet恢复.

在添加到我的 MVC 层后不久,我在数据访问和业务逻辑层上收到此错误.在那之前一切都很好,但我不知道是什么触发了这个错误.这是我的 project.json:

<代码>{版本":1.0.0-*","description": "foo bar 类库",作者":[富吧"],标签":["],项目网址":","licenseUrl": "",构架": {net451":{},dotnet5.4":{依赖":{"Microsoft.CSharp": "4.0.1-beta-23516","System.Collections": "4.0.11-beta-23516","System.Linq": "4.0.1-beta-23516","System.Runtime": "4.0.21-beta-23516",System.Threading":4.0.11-beta-23516"}}}}

这是我尝试过的:

  1. 用 这个答案.

结果是同样的错误.

  1. 将dotnet5.4"替换为net45"并保留net451".这会导致一个新错误:

<块引用>

您的 project.json 没有运行时部分.你应该添加'"runtimes": { "win":{} }' 到你的 project.json 然后重新运行 NuGet恢复.

我尝试按照此错误的建议进行操作并添加

运行时":{赢":  {}},

这给了我这个错误,我似乎无法超越:

<块引用>

您的 project.json 没有将win"列为目标运行时.你应该在 project.json 的 "runtimes" 部分中添加 '"win": {}',然后重新运行 NuGet 还原.

我已经添加了win",这开始让人感觉像是一条红鲱鱼.我在做什么直接改变 project.json,NuGet 不是在处理这个吗?

解决方案

其实我只是想出了问题所在.我最终在解决方案级别单击 Restore Nuget Packages 并设法编译了我的 PCL 文件,然后是我的解决方案的其余部分.

希望这会有所帮助.

I am using VS 2015.

Your project is not referencing the ".NETFramework,Version=4.5" framework. Add a reference to ".NETFramework,Version=4.5" in the "frameworks" section of your project.json, and then re-run NuGet restore.

I am getting this error on my Data Access and Business Logic layers, shortly after adding to my MVC Layer. Things were building fine until then, but I don't know what triggered this error. Here is my project.json:

{
  "version": "1.0.0-*",
  "description": "foo bar Class Library",
  "authors": [ "foo bar" ],
  "tags": [ "" ],
  "projectUrl": "",
  "licenseUrl": "",

  "frameworks": {
    "net451": { },
    "dotnet5.4": {
      "dependencies": {
        "Microsoft.CSharp": "4.0.1-beta-23516",
        "System.Collections": "4.0.11-beta-23516",
        "System.Linq": "4.0.1-beta-23516",
        "System.Runtime": "4.0.21-beta-23516",
        "System.Threading": "4.0.11-beta-23516"
      }
    }
  }
}

Here's what I have tried:

  1. Replacing "dotnet5.4" with "net451" (and deleting it) as found in this answer.

Result is the same error.

  1. Replacing "dotnet5.4" with "net45" and leaving the "net451". This results in a new error:

Your project.json doesn't have a runtimes section. You should add '"runtimes": { "win":{} }' to your project.json and then re-run NuGet restore.

I tried doing as this error suggested and adding

"runtimes": {
    "win":  {}
  },

This got me this error, which I can't seem to move past:

Your project.json doesn't list 'win' as a targeted runtime. You should add '"win": {}' inside your "runtimes" section in your project.json, and then re-run NuGet restore.

I've already added "win", and this is beginning to feel like a red herring. What am I doing altering the project.json directly, isn't NuGet handling this?

解决方案

I actually just figured out the problem. I ended up clicking on Restore Nuget Packages at the solution level and I managed to compile my PCL file, and then the rest of my solution.

Hope this helps.

这篇关于您的项目未引用“.NETFramework,Version=v4.5";框架.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
quot;Overflowquot; compiler error with -9223372036854775808L(编译器错误-9223372036854775808L(Q;溢出Q))
Visual Studio 2010 ReportViewer Assembly References(Visual Studio 2010 ReportViewer程序集引用)
Weird behaviour when I open a reportviewer in WPF(在WPF中打开报表查看器时出现奇怪的行为)
how do i pass parameters to aspnet reportviewer(如何将参数传递给aspnet report查看器)