Using Legacy VS projects with SonarCloud

System Info:

  • ALM used (Azure DevOps)
  • CI system used (Azure DevOps with a Private Build Agent)
  • C# + Legacy VBPROJ Installer Project
  • Error observed (##[error]Cannot process argument transformation on parameter ‘FileName’. Cannot convert value to type System.String)

The problem:
Given we are using a private build agent the server does not get created and destroyed.
When I set up the first pipeline it was all good, second the same.

The 3rd pipeline included a Legacy VBPROJ Installer Project because the project file does not conform to modern .net standards I get the aforementioned error. Due to its legacy nature it needs to be built with devenv.exe and not msbuild.exe.

So after I could not find a work around I hacked out the changes I had made to a clone of the Deployemnt Pipeline.

However when I run the original pipeline which has never had SonarCloud tasks I still get the same error.

So now I can not build the original pipeline at all.
This is a critical error four our build processes.
Assistance Required.

I have tried:

  • deleting all of the .sonarcloud folders in the agent structure
  • deleting the entire working folder set for the agent
  • deleting the the entire _work folder from the MS Build Agent

Some Questions:

  • Does SonarCloud modify the underlying templates system target templates or utilise it’s own versions of the templates?
  • Does it make a backup of those templates?
  • How do I reset the system so I can at least perform my builds until I resolve the Legacy Project Issue?

Hi,

Welcome to the community!

To be clear,

  1. You had a working pipeline
  2. You tried to set up a job that required a different compiler, so you changed the pipeline
  3. The pipeline then failed for all jobs
  4. You reverted the pipeline(???)
  5. The pipeline continues to fail for all jobs?

Also, could you post your full analysis log, please?

 
Thx,
Ann

Hi Ann

  1. You had a working pipeline
    YES, the original pippeline is in tact as was I cloned the pipeline to test
  2. You tried to set up a job that required a different compiler, so you changed the pipeline
    NO
  3. The pipeline then failed for all jobs
    NO
  4. You reverted the pipeline(???)
    NO
  5. The pipeline continues to fail for all jobs?
    YES

I had 3 Pipelines to setup.

Pipeline 1 and 2 worked without issue, both of these us dotnet and msbuild directly.

As I did with 1 and 2 I cloned the pipeline to test test the setup on Pipeline 3.
Pipeline 3 uses DevEnv build (Visual Studio) tast to run the build the command that is generated is devenv.com <solution_file> “Release|x64”.

In the clone I added the Prepare Analysis and Run Code Analysis Tasks providing the basic set of details required to execute.

Pipeline contain 2 code build tasks:

  1. Build the code solution
  2. Build the Installer solution

Test 1
Code Solution task failed with the afore mentioned error.

Since this did not actually require being run through devenv.com I swapped out that tast for a dotnet build task and ran again.

Test 2
This time it built the Code Solution but failed on the Installer Solution with the same error.

Test n
I tried a number of different configurations however none made any difference.

At this point I had to put the task off. I deleted the 3rd Pipeline Clone I had been using for testing and then tested the original pipeline which is now failing with the same error.

==============================================================================
Task         : DevEnv build (Visual Studio)
Description  : Build a project via the visual studio command-line invocation, devenv.cmd. Used for building eg. SSIS projects.
Version      : 2.0.5
Author       : Mario Majcica
Help         : Build your project via the visual studio command-line invocation, devenv.cmd
==============================================================================
##[error]Cannot process argument transformation on parameter 'FileName'. Cannot convert value to type System.String.

NOTE: the build is being performed by an up to date version of VS 2019 Comunity on our build server.

It appears the whatever changes get made by SonarCloud have stuck causing DevEnv build task to fail.

Upon investigation I can state the following:

I can build both solution in VS and on the Command line using on the build server without any issue, I have tested the outputs and they are valid and correct.

I am going to try the following:

  • Create a new pipeline with a minimal set of tasks to execut the DevEnv build task to see if it fails.
  • Determine if there is a way to run the Installer solution using msbuild

I will need to get back to you later with logs etc…

HI

I tested a new pipeline and it broke as well however upon investigation it appears to be the task which is having the issue and not the underlying build process.

So I have changed code build to run under dotnet build and the legacy installer to run as a manual powershell devenv.com build.

It appears to be working for the most part, I have some small issues to deal with but will confirm all is good some time tomorrow.

1 Like

Hello @ShawnRichards

Did you manage to solve the problem you had?

All the best,
Čaba

Apologies I thought I had posted.

The problem was with the DevBuild task and SonarCloud, I do not know what the exact issue is with this task however I resolved by using Manual Commands and not using the Specific Task.

==============================================================================
Task         : DevEnv build (Visual Studio)
Description  : Build a project via the visual studio command-line invocation, devenv.cmd. Used for building eg. SSIS projects.
Version      : 2.0.5
Author       : Mario Majcica
Help         : Build your project via the visual studio command-line invocation, devenv.cmd
==============================================================================

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.