Without making any changes to our project files, just regular code update, our builds started to fail from this monday - 21/08/2017. During the build, in the log, we get the following error at the _Restore step_:
Error: C:\Program Files\dotnet\dotnet.exe failed with return code: 1
And
Dotnet command failed with non-zero exit code on the following projects : d:\a\1\s\BD.YRD.Tests\BD.YRD.Tests.csproj
We have not made any changes to the Tests csproj. We only tried to remove the test project just to see if it builds but then it started to throw the same error for the main web project. We use hosted2017 agent. Our .net core project is 1.1.1.
Any ideas how to solve it?
This is the output from our .net info step:
_2017-08-23T08:01:05.6316895Z ##[section]Starting: Info
2017-08-23T08:01:05.6596901Z ==============================================================================
2017-08-23T08:01:05.6596901Z Task : .NET Core
2017-08-23T08:01:05.6606897Z Description : Build, test and publish using dotnet core command-line.
2017-08-23T08:01:05.6606897Z Version : 1.0.2
2017-08-23T08:01:05.6606897Z Author : Microsoft Corporation
2017-08-23T08:01:05.6606897Z Help : More Information
2017-08-23T08:01:05.6606897Z ==============================================================================
2017-08-23T08:01:07.3557124Z [command]"C:\Program Files\dotnet\dotnet.exe" --info d:a\1\s\BD.YRD.Tests\BD.YRD.Tests.csproj
2017-08-23T08:01:09.3707368Z .NET Command Line Tools (2.0.0)
2017-08-23T08:01:09.3807382Z
2017-08-23T08:01:09.3807382Z Product Information:
2017-08-23T08:01:09.3857379Z Version: 2.0.0
2017-08-23T08:01:09.4357389Z Commit SHA-1 hash: cdcd1928c9
2017-08-23T08:01:09.4357389Z
2017-08-23T08:01:09.4387377Z Runtime Environment:
2017-08-23T08:01:09.4387377Z OS Name: Windows
2017-08-23T08:01:09.4387377Z OS Version: 10.0.14393
2017-08-23T08:01:09.4707381Z OS Platform: Windows
2017-08-23T08:01:09.5137399Z RID: win10-x64
2017-08-23T08:01:09.5137399Z Base Path: C:\Program Files\dotnet\sdk\2.0.0\
2017-08-23T08:01:09.5137399Z
2017-08-23T08:01:09.5137399Z
2017-08-23T08:01:09.5137399Z Microsoft .NET Core Shared Framework Host
2017-08-23T08:01:09.5137399Z
2017-08-23T08:01:09.5137399Z
2017-08-23T08:01:09.5137399Z
2017-08-23T08:01:09.5137399Z Version : 2.0.0
2017-08-23T08:01:09.5137399Z
2017-08-23T08:01:09.5137399Z Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d
2017-08-23T08:01:09.5137399Z
2017-08-23T08:01:09.5137399Z
2017-08-23T08:01:09.5137399Z
2017-08-23T08:01:09.5147402Z [command]"C:\Program Files\dotnet\dotnet.exe" --info d:a\1\s\BD.YRD.Web\BD.YRD.Web.csproj
2017-08-23T08:01:09.5147402Z .NET Command Line Tools (2.0.0)
2017-08-23T08:01:09.5147402Z
2017-08-23T08:01:09.5147402Z Product Information:
2017-08-23T08:01:09.5147402Z Version: 2.0.0
2017-08-23T08:01:09.5147402Z Commit SHA-1 hash: cdcd1928c9
2017-08-23T08:01:09.5147402Z
2017-08-23T08:01:09.5147402Z Runtime Environment:
2017-08-23T08:01:09.5147402Z OS Name: Windows
2017-08-23T08:01:09.5147402Z OS Version: 10.0.14393
2017-08-23T08:01:09.5147402Z OS Platform: Windows
2017-08-23T08:01:09.5147402Z RID: win10-x64
2017-08-23T08:01:09.5147402Z Base Path: C:\Program Files\dotnet\sdk\2.0.0\
2017-08-23T08:01:09.5147402Z
2017-08-23T08:01:09.5147402Z
2017-08-23T08:01:09.5147402Z Microsoft .NET Core Shared Framework Host
2017-08-23T08:01:09.5147402Z
2017-08-23T08:01:09.5147402Z
2017-08-23T08:01:09.5147402Z
2017-08-23T08:01:09.5147402Z Version : 2.0.0
2017-08-23T08:01:09.5147402Z
2017-08-23T08:01:09.5147402Z Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d
2017-08-23T08:01:09.5147402Z
2017-08-23T08:01:09.5147402Z
2017-08-23T08:01:09.5147402Z
2017-08-23T08:01:09.5387414Z ##[section]Finishing: Info_
Do you have a global.json in your project that locks you to a particular version of the SDK?
Hi chrisrpatterson, no we do not have global.json. Actually, that was the first thing I tried to do - adding a global.json with targetting the SDK that we use locally but that did not help, so I took it out again.
Do not know why it shows - Version: 2.0.0 in the info log.
Can we get access to your project or at least the full build log to investigate why 2.0 is failing to restore? You can send me mail at rlander@ms.
@jakubsvobodacz what is your account name and what is the name of the build definition in question?
Hi both,
Our vsts is on: https://nnit-code.visualstudio.com/YardstickApp
Build definition name: YardstickApp-ASP.NET Core-CI
Logs from latest build:
Build steps we use:
@richlander : is your full email [email protected]? cant use just rlander@ms.
@jakubsvobodacz i think he means @microsoft.com
@jakubsvobodacz I cannot access the VSTS account, what is the target framework of your test project and the "main" project?
from the error, it could be a variation of ,
https://developercommunity.visualstudio.com/content/problem/95070/could-not-load-file-or-assembly-systemruntime-vers.html
I deleted the test project. We did not have any tests. The project was basically empty for now. the Target framework for web project is .NET Core 1.1
then we have Database project with target platform Azure SQL db V12
@jakubsvobodacz so the problem still persists? Or there was no test project from the beginning?
From the log, the build try to restore the test project,
2017-08-23T08:24:15.0811604Z [command]"C:\Program Files\dotnet\dotnet.exe" restore d:\a\1\s\BD.YRD.Tests\BD.YRD.Tests.csproj
2017-08-23T08:24:20.0549811Z Restoring packages for d:\a\1\s\BD.YRD.Tests\BD.YRD.Tests.csproj...
2017-08-23T08:24:20.0669831Z Restoring packages for d:\a\1\s\BD.YRD.Web\BD.YRD.Web.csproj...
And then, it seems failed due to the p2p reference from the Tests.csproj to the Web.csproj
2017-08-23T08:25:20.8041720Z d:\a\1\s\BD.YRD.Tests\BD.YRD.Tests.csproj : error NU1105: Unable to find project information for 'd:\a\1\s\BD.YRD.Web\BD.YRD.Web.csproj'. The project file may be invalid or missing targets required for restore.
But we do not have any references in the csproj or I do not see any:
```
```
@jakubsvobodacz Is this project _BD.YRD.Web.csproj_? Could you also show me _BD.YRD.Tests.csproj_?
As the error shows, there is a file "BD.YRD.Tests\BD.YRD.Tests.csproj", if you removed the test project, could you double check if it is building the latest branch? Could you run the build again to see if it still has the error on the test project file?
Also could you try to restore both _BD.YRD.Web.csproj_, _BD.YRD.Tests.csproj_ and could you send the pre process log to me by build with
dotnet restore BD.YRD.Tests.csproj /pp > TestsProjPreprocessResult.txt
dotnet restore BD.YRD.Web.csproj /pp > WebProjPreprocessResult.txt
and send TestsProjPreprocessResult.txt and WebProjPreprocessResult.txt to wul at microsoft.com?
Ok, we did not notice that the test project was still present in the master branch. I deleted it directly in our vsts and now the build succeeded.
We also had this error in VSTS today, after updating the global.json's sdk version from 1.0.0 to 1.1.0.
After VS2017 update the 1.0.0 version stopped working for one of our developers. The "1.1.0" version number works for him and all our other developers, but fails on VSTS.
d:a\1\s\src\Test\Test.csproj : error NU1105: Unable to find project information for 'd:a\1\s\src\Web\Web.csproj'. The project file may be invalid or missing targets required for restore.
The build succeed's when I change the sdk version back to 1.0.0, or to 1.0.4.
The VSTS hosted build agent documentation says they only have the 1.0.0 sdk installed: https://www.visualstudio.com/en-us/docs/build/concepts/agents/hosted#hosted-vs2017
However, there seems to be many other versions as well. I made build steps _dotnet --version_ and _dir "C:\Program Files\dotnet\sdk"_, and there seems to be that asked version 1.1.0 and it also uses it. For some reason, dotnet restore fails on VSTS but not locally when using the 1.1.0 sdk version.
_dir "C:\Program Files\dotnet\sdk"_ on VSTS build agent:
1.0.0
1.0.0-preview2-003121
1.0.0-preview3-004056
1.0.0-preview4-004233
1.0.0-rc3-004530
1.0.0-rc4-004771
1.0.0-rc4-004802
1.0.0-rc4-004834
1.0.0-rc4-004847
1.0.2
1.0.3
1.0.4
1.1.0
2.0.0
NuGetFallbackFolder
I'm hitting this issue as well.
For me, it seems that BundlerMinifier.Core is the offender. If you remove that tool, restore succeeds.
After updating to .NET Core 2.0, we're experiencing the same issue on VSTS. Any test project referencing a .NET Core app 2.0 web project fails with "error NU1105: Unable to find project information for {the web project}" If we remove the test project, then everything builds fine on VSTS. If we add a reference to the web project from other test files, those fail also.
@trbngr Thanks. This worked for me.
For others, to be more specific, comment out:
<DotNetCliToolReference Include="BundlerMinifier.Core" Version="X.X.XXX" />
The PackageReference can stay.
Yep same with EF core
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.0" PrivateAssets="All" />
If I commented this line all sln build successfully. If not -> csproj builded, solution isn't.
@verysimplenick what did you do to fix your issue? I'm having the same issue.
@singhbibek - create a new issue
@deanilvincent , yes fixed in nuget https://github.com/NuGet/Home/issues/5941
Guys, I was having the same problem reported by @jakubsvobodacz, but I managed to succeed in the build with a combination of adjustments, which I share with you:
聽聽<ItemGroup>
聽聽聽聽<PackageReference Include = "Microsoft.AspNetCore.All" Version = "2.0.3" />
聽聽聽聽 <! - <PackageReference Include = "Microsoft.NETCore.App" Version = "2.0.4" /> ->
聽聽</ ItemGroup>
<Project Sdk = "Microsoft.NET.Sdk">
聽聽<PropertyGroup>
聽聽聽聽<TargetFramework> netcoreapp2.0 </ TargetFramework>
聽聽聽聽<IsPackable> false </ IsPackable>
聽聽聽聽<RuntimeFrameworkVersion> 2.0.3 </ RuntimeFrameworkVersion>
聽聽</ PropertyGroup>
聽聽<PropertyGroup>
聽聽聽聽<LangVersion> latest </ LangVersion>
聽聽</ PropertyGroup>
聽聽<ItemGroup>
聽聽聽聽<PackageReference Include = "Microsoft.AspNetCore.All" Version = "2.0.3" />
聽聽聽聽<PackageReference Include = "Microsoft.NET.Test.Sdk" Version = "15.5.0" />
聽聽聽聽**<! - <PackageReference Include = "Microsoft.NETCore.App" Version = "2.0.4" /> ->**
聽聽聽聽<PackageReference Include = "Moq" Version = "4.7.145" />
聽聽聽聽<PackageReference Include = "xunit" Version = "2.3.1" />
聽聽聽聽<PackageReference Include = "xunit.runner.visualstudio" Version = "2.3.1" />
聽聽</ ItemGroup>
聽聽<ItemGroup>
聽聽聽聽<DotNetCliToolReference Include = "dotnet-xunit" Version = "2.3.1" />
聽聽</ ItemGroup>
</ Project>
{
聽聽 "projects": ["src", "tst"],
聽聽 "sdk": {
聽聽聽聽 "version": "2.1.3"
聽聽 }
}
ITS REALLY .. fed up of this error what need to do .. tried in multiple ways now with the help of some solutions given here by various guys.. let see trying ..
now this is the last error what we all were facing.... by the way these vedio helped me but still facing ERROR
Error: C:\hostedtoolcache\windows\dncs\1.0.4x64\dotnet.exe failed with return code: 1
https://docs.microsoft.com/en-us/vsts/pipelines/languages/dotnet-core?view=vsts&tabs=designer
Apparently, adding a Nuget Restore task before .NET Core Restore worked for me.
Closing as this is not a Tasks issue. There are fixes to apply to the csproj files to resolve the errors.
Most helpful comment
@jakubsvobodacz i think he means @microsoft.com