0

I'm trying to run sonar on a .NET project.

I have installed all the c# plugin and I'm trying to run sonar runner on my project.

The problem is that somewhere in the process it deletes all the files. After that it gives an error that it can't run the analysis since the .sln is missing.

The output from the runner is here: http://pastebin.com/kmu7fiDG

And my sonar-properties configuration: http://pastebin.com/sXevLgFd

I'm executing the runner from the directory where the .sln and the sonar-project.properties are located.

Any ideas why it's deleting the source?

Kenneth
  • 28,294
  • 6
  • 61
  • 84

1 Answers1

1

This is because of the following:

sonar.working.directory=C:/Users/ktruyers/Projects/MvcContacts
sonar.projectBaseDir=C:/Users/ktruyers/Projects/MvcContacts

With this, you are telling Sonar that the base directory of your project is also the temp directory where Sonar will put is temporary files during the analysis. And this folder is cleaned up when starting an analysis...

You should therefore remove the property sonar.working.directory. I don't know where you found this, but this is not documentated anywhere in the C#/.NET documentation...

  • Hm, yes, I just came to that conclusion as well. Thanks! The problem I'm having is that I'm trying to run sonar through Jenkins. When I do that and I leave these out, it can't find the .sln-file. A possible solution would be to move the runner to the project directory, but that seems a bit stupid, because I'd need a sonar runner for every project I want to build. Any idea on where I can set where to look for the directory? – Kenneth May 24 '13 at 12:49