ASP.NET Core Application (.NET Framework) for Windows x64 on

ASP.NET Core Application (.NET Framework) for Windows x64 only error in project.assets.json(ASP.NET Core Application (.NET Framework) for Windows x64 only error in project.assets.json)
本文介绍了ASP.NET Core Application (.NET Framework) for Windows x64 only error in project.assets.json的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我想使用 VS 2017 简化我在 ASP.NET Core Web 应用程序 (.NET Framework) 应用程序中的配置.

I want to simplify my configuration in my ASP.NET Core Web Application (.NET Framework) application using VS 2017.

我已经知道我的网站将在 x64 环境和 .NET 4.6.2 的 Windows/IIS 下运行.在可预见和不可预见的未来,此应用程序不可能使用从开发到生产的任何其他环境.

I already know that my website will be running under Windows/IIS in x64 environment and .NET 4.6.2. There is no chance in the foreseen and unforeseen future for this application to use any other environment from the dev to production.

所以,我只需要 Debug x64 和 Release x64 模式.(不需要 AnyCPU 和 x86!),所以我继续从项目中删除了所有其他配置.

So, I only need Debug x64 and Release x64 modes only. (AnyCPU and x86 are not needed!), so I went ahead and removed all other configuration from the project.

现在,在编译时,我收到以下错误:

Now, upon compilation, I am getting the following error:

'C:ProjectsMyProjectMy.Websiteobjproject.assets.json' 没有有一个.NETFramework,Version=v4.6.2/win7-x64"的目标.

'C:ProjectsMyProjectMy.Websiteobjproject.assets.json' doesn't have a target for '.NETFramework,Version=v4.6.2/win7-x64'.

确保你已为 TargetFramework='net462' 恢复了此项目,并且运行时标识符='win7-x64'.MD.Website C:Program Files(x86)微软视觉Studio2017EnterpriseMSBuildSdksMicrosoft.NET.SdkuildMicrosoft.NET.Sdk.targets

Ensure you have restored this project for TargetFramework='net462' and RuntimeIdentifier='win7-x64'. MD.Website C:Program Files (x86)Microsoft Visual Studio2017EnterpriseMSBuildSdksMicrosoft.NET.SdkuildMicrosoft.NET.Sdk.targets

我正在 Windows 7 上开发,我不知道如何解决这个问题.有什么想法吗?

I am developing on Windows 7, I am not sure how to fix this one. Any idea?

推荐答案

由于某种原因,我的 .csproj 文件中的 <TargetFramework> 是单数.我添加了一个s",它变成了TargetFrameworks",它起作用了:

For some reason <TargetFramework> in my .csproj file was singular. I added an "s" and it became "TargetFrameworks", which worked:

  <PropertyGroup>
    <TargetFrameworks>net462</TargetFrameworks>
    <RuntimeIdentifier>win7-x64</RuntimeIdentifier>
  </PropertyGroup>

这篇关于ASP.NET Core Application (.NET Framework) for Windows x64 only error in project.assets.json的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

MSBuild cannot find a reference(MSBuild 找不到参考)
The reference assemblies for framework .NETCore, Version=v5.0 were not found(未找到框架 .NETCore,Version=v5.0 的参考程序集)
quot;File has a different computed hash than specified in manifestquot; error when signing the EXE(“文件的计算哈希值与清单中指定的不同签署EXE时出错)
Good-practices: How to reuse .csproj and .sln files to create your MSBuild script for CI?(良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 MSBuild 脚本?)
Run an MSBuild target only if project is actually built(仅在实际构建项目时运行 MSBuild 目标)
MS-Build BeforeBuild not firing(MS-Build BeforeBuild 未触发)