dotnet restore exit code is always 0
See original GitHub issueSteps to reproduce
- have an invalid csproj:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<!--<RuntimeFrameworkVersion>2.0.0-preview1-005957-00</RuntimeFrameworkVersion>-->
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="xunit" Version="2.3.0-beta2-build3683" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta2-build1317" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="1.1.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\API.csproj"></ProjectReference>
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project>Invalid Characters to fail processing of the project file
then dotnet restore
Expected behavior
/app/code/test/IntegrationTests/IntegrationTests.csproj(18,11): error MSB4025: The project file could not be loaded. Data at the root level is invalid. Line 18, position 11
.
exit code is not 0
Actual behavior
exit code is 0
Environment data
dotnet --info
output:
.NET Command Line Tools (2.0.0-preview1-005957)
Product Information:
Version: 2.0.0-preview1-005957
Commit SHA-1 hash: 056ac0e9cd
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.12
OS Platform: Darwin
RID: osx.10.12-x64
Base Path: /usr/local/share/dotnet/sdk/2.0.0-preview1-005957/
Microsoft .NET Core Shared Framework Host
Version : 2.0.0-preview1-002111-00
Build : 1ff021936263d492539399688f46fd3827169983
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
asp.net core - dotnet restore fails from Docker container
The actual error seems to be: Unable to load the service index for source https://api.nuget.org/v3/index.json.
Read more >dotnet test command - .NET CLI
If all tests are successful, the test runner returns 0 as an exit code; otherwise if any test fails, it returns 1.
Read more >dotnet restore command - .NET CLI
Learn how to restore dependencies and project-specific tools with the dotnet restore command.
Read more >dotnet build command - .NET CLI
The dotnet build command builds a project and all of its dependencies. ... The file is created when dotnet restore is executed.
Read more >dotnet publish command - .NET CLI
dotnet publish compiles the application, reads through its dependencies specified in the project file, and publishes the resulting set of files ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@nguerrera you need two projects and a sln referencing the two projects. then you mess up with one and restore the sln. either the return code is the one fro the last project, either it is OR’ed and should be AND’ed (not really english!)
it will return 0.
This issue was moved to Microsoft/msbuild#2113