Issues with MSBuild compile relating to invalid confguration in MicroFocus.COBOL.CurrentVersion.targets

We have been implementing an upgrade from Visual COBOL 2.3.2 to COBOL 8.6 and have been utilizing it within our development environment from Visual Studio.  We have now moved to our TFS server which is 14.114.26403.0 (Tfs2015.Update4) running on Windows Server 2016 Datacenter.

Initially our TFS build was failing due to the missing COBOL version in our project files however after this was updated, we received errors relating to the MicroFocus.COBOL.CurrentVersion.targets.  The first issue was with the same version error, however after fixing the version configuration in the targets file we are running into more issues with the builds.  Before I go modifying anything else to have this working, I'd like to ensure I am going along the right path.

What I have done so far:

  • Created an offline Visual Studio 2019 Enterprise layout with all of the required packages.  Installed Visual Studio 2019 Enterprise
  • Performed all of the steps in https://www.microfocus.com/documentation/visual-cobol/vc80/VS2019/GUID-F27673CD-0800-4A75-9074-D832CA3E1FA3.html including registering the certificates.
  • Applied all PU's up to 6 (As this is what had been tested previously with Visual Studio)
  • Added the COBOL version to the runtime in all COBOL project files.
  • Performed successful compiles within Visual Studio 2019 on the server.
  • The following reference in MicroFocus.COBOL.CurrentVersion.targets was updated to:
    • <ItemGroup Condition="'$(DisableImplicitCOBOLRuntime)' != 'true' and '$(DisableImplicitFrameworkReferences)' != 'true' and ('$(TargetFrameworkIdentifier)' == '.NETStandard' or '$(TargetFrameworkIdentifier)' == '.NETCoreApp')">
      <PackageReference Include="MicroFocus.COBOL.Runtime, Version=8000.6.0.85, IsImplicitlyDefined=true" />
      </ItemGroup>

From what I can tell the version of MicroFocus.COBOL.CurrentVersion.targets is outdated and requires updates.

Any assistance would be greatly appreciated.

  • Verified Answer

    +1  

    Hi James,

    Can you please show us what the actual errors look like?
    You shouldn't need to modify anything to get this to work.

    Was the 2.3 version installed on this server prior to installing V8.0 or was V8.0 a fresh install?

    Are you perhaps using an older version of msbuild from a previous version of Visual Studio?

    Thanks

    Chris Glazier
    Rocket Software - Principal Technical Support Specialist
    If you found this post useful, give it a “Like” or click on "Verify Answer" under the "More" button

  • Suggested Answer

    0 in reply to   

    Hi Chris

    I eventually got everything working by modifying the MicroFocus.COBOL.CurrentVersion.targets file and changing the TFS build steps to use MSBuild targetting the MSBuild from VS2019 instead of Visual Studio build (which only allowed VS22015).

    The errors were around the version attribute not being recognized in the package reference.  After that it was

    Error MSB4135: The function "ProcessArchitecture" on type "System.Runtime.InteropServices.RuntimeInformation" is not available....

    Followed by a few other errors that I then managed to get through and fix.

    Reading this response this morning I believe you've hit the nail on the head with "Was the 2.3 version installed on this server prior to installing V8.0 or was V8.0 a fresh install?".  I compared the v1 folder in MSBuild\Micro Focus from my Windows 10 VM (which was a fresh install) to the version on the TFS server (where I had uninstalled v2.3) and I can indeed see the changes I made along with a lot of additional targets that I had obviously not known about.  I can confirm that after copying the files from my VM to the server the build is chugging along nicely now.

    Given this appears to have been the issue, am I correct in saying that the uninstall of 2.3 does not remove the Micro Focus information from the MSBuild directory?

    Regards

    James

  • 0   in reply to 

    Hi James,

    I tested the uninstall with the Visual COBOL V2.3 product installed into VS 2015 and it sucessfully deleted all the Micro Focus files. I am not sure what happened in your case.

    Chris Glazier
    Rocket Software - Principal Technical Support Specialist
    If you found this post useful, give it a “Like” or click on "Verify Answer" under the "More" button