找不到project.assets.json-TFS生成服务器,没有互联网 [英] project.assets.json not found - TFS Build Server, no internet

查看:88
本文介绍了找不到project.assets.json-TFS生成服务器,没有互联网的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正处于从VS2013& 15 / TFS2013到VS2017 / TFS2017(现场TFS而非VSTS)的过渡过程中,第一个测试解决方案是基于dotNet Core 1.1的解决方案(多项目Web服务) )。



该解决方案可以在原始开发人员的盒子上构建良好,我已经从TFS中将其删除,并且在我的产品上也可以构建良好。与我们以前的方法一致,将软件包文件夹的内容与项目一起检入,因为这使软件包可以在构建框中本地使用(不使用Internet)。但是,在构建服务器上的解决方案却是另一回事,因为我遇到了多种形式的错误...

 。找不到\obj\project.assets.json'。运行NuGet软件包还原以生成此文件。 

我在运行TFS构建定义以及远程访问框并构建时都收到错误直接通过盒子上的VS。



整个project.assets.json找不到问题似乎遍地都是。就我而言,问题是我正在尝试在我们的TFS 2017 Build Server上解决该问题,没有并且永远也不会访问互联网('这是一台服务器!)。



到目前为止,我所见过的所有解决方案似乎都建议运行Nuget Restore命令,但由于服务器无法进入nuget,因此无法运行。



这还算不上什么,只是一个简单的TFS 2017 Build定义,其中包含一个获取源代码和一个 Build solution 步骤。我不明白如此简单的事情变得如此困难。



更改Nuget包的还原选项没有什么区别。



由于project.assets.json文件是在obj文件夹中即时生成的,所以我什至无法检入它们以进行重用。任何人都可以提出一个解决方法,此刻测试项目陷入困境。



编辑:使用VS2015创建的4.6.1 Web项目尝试相同的过程有未解决的引用(例如System.Web)的类似结果,但未引发相同的错误,可能是由于它是一个较旧的非核心项目。

解决方案方案

根据在运行TFS构建定义时以及在远程访问框并通过VS直接在框本身上进行构建时,都会收到错误。



该问题似乎与TFS生成方面无关,因为它也不适用于通过Build Agent计算机中的VS进行本地构建。



因为这是一个dotnet项目。因此,您可以尝试使用 dotnet还原而不是 nuget restore。尝试使用dotnet核心模板(使用dotnet还原)。



如果您使用的是经过身份验证的nuget feed,则可以使用nuget restore,但还需要使用nuget安装程序任务。参见 https://github.com/Microsoft/vsts-tasks/issues/3762对此进行讨论。
Nuget版本应高于4.0。



如果没有dotnet恢复和Nuget恢复,仅使用get source / Visual Studio Build将无法生成dotnet核心项目。如果您的服务器无法访问Internet,则应使用本地供稿


We're just in the process of transitioning from VS2013&15/TFS2013 to VS2017/TFS2017 (on-site TFS, not VSTS) and the first test solution is a dotNet Core 1.1 based one (a multi-project web service).

The solution builds fine on the original developer's box and I've got it out of TFS and it builds fine on mine too. In keeping with our previous methodology the contents of the packages folder are checked in with the projects as this makes the packages locally available on the build box (no internet).

Building the solution on the build server is a different story, however, as I get multiple errors of the form...

..\obj\project.assets.json' not found. Run a NuGet package restore to generate this file.

I get the errors both when I run the TFS build definition and when I remote to the box and build directly through the VS on the box itself.

This whole project.assets.json not found issue seems to be causing headaches all over. In my case the issue is that I'm trying to resolve it on our TFS 2017 Build Server, which does not and never will have internet access ('cos it's a server!).

All the solutions I've seen thus far seem to suggest running the Nuget Restore command but that can't work since the server cannot get to nuget.

This is nothing fancy yet, just a simple TFS 2017 Build definition with a Get sources and a Build solution step. I can't understand how something so simple has become so difficult.

Changing the Nuget Package Restore options makes no difference.

Since the project.assets.json files are generated on the fly in the obj folder, I can't even check them in to reuse. Can anyone please suggest a workaround, at the moment the test project is dead in the water.

Edit: trying the same process with a 4.6.1 web project created with VS2015 had similar results of unresolved references (e.g. System.Web) but didn't raise the same error, probably due to being an older, non-Core project.

解决方案

According to I get the errors both when I run the TFS build definition and when I remote to the box and build directly through the VS on the box itself.

The issue seems not related to TFS build side since it also not work with local build through VS in the build agent machine.

Since this is a dotnet project. So, you could try to use "dotnet restore" and not "nuget restore". Try using the dotnet core template (which uses dotnet restore).

If you are using authenticated nuget feeds, then you can use nuget restore but you also need to use nuget installer task. See https://github.com/Microsoft/vsts-tasks/issues/3762 for a discussion on that. The Nuget version should be higher than 4.0.

Without dotnet restore and Nuget restore and only use get source/Visual Studio Build will not be able to build the dotnet core project. If your server do not have internet access, as a workaround you should use Local feeds.

这篇关于找不到project.assets.json-TFS生成服务器,没有互联网的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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