Compilation error with enterprise developper 2017(v6)

Hi,

I upgraded a project from a v2 project to version v6.

I have change the ToolsVersionattribute in the .cblproj to 15.0

***ToolsVersion="4.0" to ToolsVersion="15.0"

After this change, I always have an error when i running the build.

* Compiling C:\AGE-VSTS\vsts-agent2\_work\484\s\Lot\Util\CBL2SQL\CBL2SQL.CBL

##[error]Lot\Util\CBL2SQL\CBL2SQL.CBL(123,49): Error COBCH0860: Object references must be specified at 01 level

C:\AGE-VSTS\vsts-agent2\_work\484\s\Lot\Util\CBL2SQL\CBL2SQL.CBL(123,49): error COBCH0860: Object references must be specified at 01 level [C:\AGE-VSTS\vsts-agent2\_work\484\s\Lot\Util\CBL2SQL\CBL2SQL.cblproj]

##[error]Lot\Util\CBL2SQL\CBL2SQL.CBL(124,49): Error COBCH0860: Object references must be specified at 01 level

Any idea?

Regards

Eric

  • Are you building from the command line or from within Visual Studio?

    According to the Visual Studio docs starting with VS 2017 it should no longer use this setting in the project file. Instead it should use the latest build tools regardless of that setting. The link I found is here:

    The section referring to VS2017is here:

    "Toolset properties specify the paths of the tools. Starting in Visual Studio 2017, MSBuild no longer has a fixed location. By default, it is located in the MSBuild\15.0\Bin folder relative to the Visual Studio installation location. In earlier versions, MSBuild uses the value of the ToolsVersion attribute in the project file to locate the corresponding registry key, and then uses the information in the registry key to set the Toolset properties. For example, if ToolsVersion has the value 12.0, then MSBuild sets the Toolset properties according to this registry key: HKLM\Software\Microsoft\MSBuild\ToolsVersions\12.0."

    VC/ED 6.0 finds the build tools using a different approach than earlier releases. There is a command called cblms that can be used to query or set the versions and locations of the Build Tools or SDK to use. The documentation for this can be found here:

  • Eric, 

    When compiling your project as managed COBOL, which you are doing, references to .NET objects cannot be defined as part of a group item, they have to be 01 level, which is what the message is saying so you will need to modify your code accordingly. 

     The ToolsVersion is not the reason for the compilation error.