Visual studio Post Build Events

  • ALM used, Azure DevOps
  • CI system used, Azure DevOps
  • Languages of the repository C#
  • Private SonarCloud is being used.

I have seen some posts in this community where people asking for help, the first reply is “Do you have post build events”?

I’ve just added some post build events to my Visual Studio solution, now my pipeline build fails with

##[error]ERROR: Failed to find InputFile for D:\a\1\s\ blah blah file name.cshmtl

I get a few of these errors.
The files do exist, and what I find strange is the error is from a csproj file where I haven’t added any post build events?

I have added ‘rem’ to the post build events in the order that they don’t get executed.
I’ve rerun the pipeline and everything is fine.

So what’s the score with having post-build events?

Also, I don’t know if it’s related but the Publish Quality Gate Result has gone from 2 or 3 minutes to over an hour. I don’t know if this has anything to do with the post build events or that I reviewed some of the issues highlighted for the first time? either way, I had to disable it in my pipeline which isn’t good.

After disabling the “Publish Quality Gate Result” task in my pipeline I thought I’ll run it with the post build events back, but with the quality gate still disable and everything is good.

If anyone can shed some light on what’s going on here I’d really appreciate it.

Hi @C3SoftwareUK

Not sure to understand your problem here : what are you trying to achieve at the end ?

Thank you.

I have two end goals.
1 - Is there a problem with using Visual Studio Post Build Events and Sonarcloud?
2 - For my pipeline not to fail. (I have to remove Publish Quality Gate Result for it to work)

I don’t see any.

We had a service outage this week end, ending up with many analyses timing out, you may have fall into that, i suggest that you retry today to see if this occurs again.

With that one more small issue that the sonrqube only analyzing the xml files… Not the sln or csproj etc. Can please help to resolve this issue

Which scanner are you using ?

Sonar scanner

And MS build

Hi Yes, that was the issue, the service outage. All is good in my world.
I did check the status page and it was everything was green, clearly, it wasn’t…

So not SonarScanner for MSBuild ?

Yes, that one only… Just now issue resolved. But a small question… Will it not read the. SLN files. I am using community version

Scanner for MSBuild will only analyze file part of a project, but not the csproj neither the SLN.

Is it possible that these both will get analyzed in azure devops