English 中文(简体)
VS 15.8.2 破碎的建筑工具——失踪的RuntimeIdentifier
原标题:VS 15.8.2 broke build tools - missing RuntimeIdentifier

The last windows update has broken our whole build chain and I am a little at a loss at what causes it.

我有一个遗产项目,即VS2017解决方案,有大量项目(双向、双网、只靠网上浏览)。

当地情况完全可行。 我只能建设他们。

在服务器上,假日已经开始失败,错误是:

C:Program Files (x86)Microsoft Visual Studio2017BuildToolsMSBuildMicrosoftNuGet15.0Microsoft.NuGet.targets(186,5): Error : Your project file doesn t list  win  as a "RuntimeIdentifier". You should add  win  to the "RuntimeIdentifiers" property in your project file and then re-run NuGet restore.

C:Program Files (x86)Microsoft Visual Studio2017BuildToolsMSBuildMicrosoftNuGet15.0Microsoft.NuGet.targets(186,5): Error : Your project file doesn t list  win  as a "RuntimeIdentifier". You should add  win  to the "RuntimeIdentifiers" property in your project file and then re-run NuGet restore.

C:Program Files (x86)Microsoft Visual Studio2017BuildToolsMSBuildMicrosoftNuGet15.0Microsoft.NuGet.targets(186,5): Error : Your project file doesn t list  win  as a "RuntimeIdentifier". You should add  win  to the "RuntimeIdentifiers" property in your project file and then re-run NuGet restore.

Process  msbuild.exe  exited with code  1 .

我补充说:

<RuntimeIdentifiers>win</RuntimeIdentifiers>

一些项目。 无改动。 我正在遭受损失,因为错误信息甚至没有告诉我什么项目。

问题回答

Add this: <RuntimeIdentifier>win</RuntimeIdentifier> to your project file, for example after element TargetFrameworkVersion. Make sure the element name is singular. RuntimeIdentifiers on the other hand is used in the new csproj format

或者说,你可以把你作为管理人的威斯特尔语的文字放在你项目的基本目录上。

Get-ChildItem . -include bin,obj -Recurse | foreach { remove-item $_.fullname -Force -Recurse }

本稿将删除所有切片和双管。

在我解决问题的步骤之后,我在2019年5月16日(16.8.6)也发生了同样的错误。

  1. Close visual studio (other visual studio instances may remain)
  2. Delete all bin and obj folders in all projects in the solution
  3. Reopen solution and Build

请注意,如果存在双管齐下,只删除双管束,你也需要删除双管。

采用一揽子方案的项目是否存在这一问题 人工恢复一揽子计划时的考虑

NuGet.exe restore my.sln

as part of a TeamCity build (so might be related nf313743 s answer https://stackoverflow.com/a/60951212/128384) and then building projects using msbuild. This would result in the following error when msbuild begins dealing with the PackageReference:

[ResolveNuGetPackageAssets] C:Program Files (x86)Microsoft Visual Studio2017CommunityMSBuildMicrosoftNuGet15.0Microsoft.NuGet.targets(186, 5):
Your project file doesn t list  win-x86  as a "RuntimeIdentifier". You should add  win-x86  to the "RuntimeIdentifiers" property in your project file and then re-run NuGet restore.

在这里删除 ob头等,因为它们通过<条形状> 插入<> > > > > ; 添加一个可操作性识别器,但在VS2017 指挥线上打上准确的同一条,因此,明显区别是City如何建立环境。

第1号呼吁的输出中可以找到主犯:

NuGet.exe restore my.sln -NonInteractive
MSBuild auto-detection: using msbuild version  16.10.2.30804 
from  C:Program Files (x86)Microsoft Visual Studio2019CommunityMSBuildCurrentin .

它使用从VS2019安装中铺设的ms,而该项目是由VS2017建造的,因此,有些地方在混杂了那些没有预料到的不相容。 不管怎么说,关键因素很可能是,团队会创造像VS2017指挥线这样的完全环境,NuGet文件指出

By default the MSBuild in your path is picked,
otherwise it defaults to the highest installed version of MSBuild.

因此,它使用了VS2019。 解决办法是人工通过<代码>-MsBuildPath至NuGet,并将之与组群中选定的建筑群对应。

NuGet.exe -msBuildPath "%MSBuildTools15.0_x86_Path%" restore my.sln

(and it turns out teamCity itself is also plagued by this in its own NuGet step: How to set the MSBuild verision for TeamCity NuGet Installer?)

我也存在同样的问题。 我的错误是:

error : Your project file doesn t list win10 as a "RuntimeIdentifier". You should add win10 to the "RuntimeIdentifiers" property in your project file and then re-run NuGet restore.

Well, it turned out I just had to change by build target from "Any CPU" to something else (x64 for example)...

我也有类似的情况。 我试图在安装视力演播室时通过调制成解决办法,仅仅安装了最新版本的“2017年”建筑工具。 我在此采取的步骤:

  1. dotnet restore a.sln (There are some .Net Standard Library project in this solution, the others are .NET 4.7.2 projects).
  2. call msbuild.exe to build this solution.
  3. I got the error of "missing RuntimeIdentifier".

你们的项目档案没有打赢“RuntimeIdentifier”。 你们应当把“RuntimeIdentifiers”财产添加到你们的项目档案中,然后重新启用NuGet。

It seems an issue in the old version of Nuget. Please refer here. Finally, I resolved it via restore packages with the latest Nuget (v5.0.2). the steps:

  1. Delete obj and bin folders
  2. nuget.exe restore a.sln
  3. call msbuild.exe

you got to figure out which projects in your solution trigger this error. you can find this if you look at the error panel. go to that projects locations and delete both the bin and the obj folders. then rebuild. should be alright

我有同样的问题,跨越羊毛建筑链(VS2017/VS2019)——这里是我确定的——通过<条码>清洗的武力。

Your project file doesn t list win as a "RuntimeIdentifier". You should add win to the "RuntimeIdentifiers" proper ty in your project file and then re-run NuGet restore

Remove Intermediary Build Output Artifacts

rimraf *obj**

我收到与原海报相同的错误,女士build诉15.9。

Your project file doesn t list  win  as a "RuntimeIdentifier". You should add  win  to the "RuntimeIdentifiers" property in your project file and then re-run NuGet restore

我的项目是:net Framework v4.6.2. 这些项目在当地使用VS2017,但在利用10.0.5团队精神时失败。 我最近把我的项目从包装变成包裹,造成建筑失败。

我的解决办法是,在建立解决办法之前,增加一个新的建设步骤,以迅速恢复解决的植被。 似乎在将项目转换成一揽子计划之前,这项工作是在暗含的一步上进行的。

To projects mult-target fmk Add this to your project file, f或 example:

<PropertyGroup>
  <RuntimeIdentifier>ubuntu.16.04-x64</RuntimeIdentifier>
</PropertyGroup>

<PropertyGroup>
  <RuntimeIdentifier>win</RuntimeIdentifier>
</PropertyGroup>

因此,我在DevOps大楼的服务器上看到了同样的错误信息,但在视觉演播室以及指挥线上铺设了罚款。

我经过检查,国际电算中心有<代码><RuntimeIdentifiers>在我的项目档案中界定,在服务器上清除了 ob和双双双双倍器,NOT对我做了固定。

我们的问题是,我们有lt;RuntimeIdentifiers> 标签在建筑部分显示MultamIPLE的时代,(可能来自过去某个时候的坏merge合)。 在拆除了重复的标签之后,DevOps成功地建造了该项目。

我花了几个小时时间,从来不 st,因为这个问题是任何其他人的问题的根源。 如果某个人有同样的问题,希望将来会节省一些时间。

For me, it was as simple as compiling a Windows IoT App with x86 platform instead of ARM.

就我而言,这是在建造一座大楼时发生的。

我得以解决这个问题,迫使建筑群使用2019年演播室视觉工具。

我修改了我们的build.cake文档,以便MSBuild步骤包括VS-2019年的“使用工具包”等:

     MSBuild(_solutionFile, settings => settings.SetConfiguration(_configuration)
         .UseToolVersion(MSBuildToolVersion.VS2019));

我的唯一工作是删除所有项目档案,并从版本控制中再次下载。 然后,问题就消失了。

如果你是“Fat&ric”或其他64bit环境,则检查你有以下一致的条目:lt;PlatformTarget>x64</PlatformTarget>,载于all。 在我的案件中,由于许多配置之一有:<代码><PlatformTarget>AnyCPU</PlatformTarget>,该公司在当地只建造了罚款,但未能在CI服务器上安装。

I always get this error in the Azure pipeline. So far I have noticed the following fixed for me in various occasions: 1. do not commit the .suo file - if so, delete and recommit 2. do not commit the bin or obj folders - if so, delete and recommit 3. if there is a new project added, set the project dependency on the solution properties - save and commit the .sln file

在我升级至15.9.27后,一个单位测试项目未能汇编成册,我也存在同样的问题,删除了我为我工作的切片人的解决办法。

在叫MSBuild之前,一个简单的核植被恢复为我工作。 我有针对性的项目。 NET Framework 4.7.2 (not SDK) 我从一揽子计划搬出的生活方式、遗产风格。 config syntax。

I experienced this issue with a MSBUILD project that I ve added into a solution of VS2015 and VS2019, that project was compiled with VS2010. I just excluded it from solution and compiled it with VS2010, including the .DLL file into other projects that work with VS2015 and VS2019.

I m using VS 2019 (16.11.17). I was working in 2022 on a different branch.

我尝试了所有这些解决办法,在我删除解决办法的夹和带新鲜东西之前,没有任何办法奏效。

Remove all obj folders from your solution by running the following command line script, then try a full rebuild:

for /d /r "C:YourDirectoryPath" %d in (obj) do @if exist "%d" rmdir /s /q "%d"




相关问题
How to restart Visual Studio manually?

Is there any way to restart Visual Studio 2010 (and possibly 2008 as well but not so important) manually and keeping the current state (i.e. all open solutions/projects and files)? Basically the same ...

How to add service reference in visual studio 2017

i am trying to add a service reference in visual studio 2017, when i add this via right click on reference -> add service reference then it s giving following error as per "https://aka.ms/...

热门标签