Skip to content

Indentation on .csproj breaks the build #2281

Open
@darioquintana

Description

@darioquintana

Indentation breaks the .csproj file.

Error:

dotnet build DoesntWorks.csproj
Microsoft (R) Build Engine version 15.7.177.53362 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 40.4 ms for /Users/dario/src/core-dal/src/CoreViejo/DoesntWorks.csproj.
/usr/local/share/dotnet/sdk/2.1.200/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.TargetFrameworkInference.targets(96,5): error : The TargetFramework value 'netcoreapp2.0' was not recognized. It may be misspelled. If not, then the TargetFrameworkIdentifier and/or TargetFrameworkVersion properties must be specified explicitly. [/Users/dario/src/core-dal/src/CoreViejo/DoesntWorks.csproj]

Build FAILED.

/usr/local/share/dotnet/sdk/2.1.200/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.TargetFrameworkInference.targets(96,5): error : The TargetFramework value 'netcoreapp2.0' was not recognized. It may be misspelled. If not, then the TargetFrameworkIdentifier and/or TargetFrameworkVersion properties must be specified explicitly. [/Users/dario/src/core-dal/src/CoreViejo/DoesntWorks.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:01.06

File that works:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework>
  </PropertyGroup>

</Project>

Indented file that doesn't works:

<Project Sdk="Microsoft.NET.Sdk">
	<PropertyGroup>
		<TargetFramework>
			netcoreapp2.0
		</TargetFramework>
	</PropertyGroup>
</Project>

Solution:
Disabling indentation tool on Visual Studio Code for .csproj files.

My dotnet --info:

.NET Command Line Tools (2.1.200)

Product Information:
 Version:            2.1.200
 Commit SHA-1 hash:  2edba8d7f1

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.13
 OS Platform: Darwin
 RID:         osx.10.13-x64
 Base Path:   /usr/local/share/dotnet/sdk/2.1.200/

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.7
  Build    : 2d61d0b043915bc948ebf98836fefe9ba942be11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions