Getting auth error. Verify .NET analysis command?

Hi @ganncamp

Im facing the same issue. Can you please verify the .Net command? Im not sure if the command reads the project property file properly.

Command used to execute:

dotnet sonarscanner begin /k:“xxxx” /d:sonar.host.url=“https://sonarqube.xxxx.com” /d:sonar.login=“xxxxxx” /d:project.settings=“C:\xxxxx\sonar-project.properties”

Here is my sonar-project.properties file. I have removed values.

# required metadata
sonar.projectKey=proj1
sonar.projectName=proj1
sonar.projectVersion=1.6
sonar.organization=proj1
sonar.sources='sources list'
sonar.javascript.lcov.reportPath=
sonar.javascript.jstest.reportsPath=

#ignore rules
sonar.issue.ignore.multicriteria=

# function complexity
sonar.issue.ignore.multicriteria.e1.ruleKey=
sonar.issue.ignore.multicriteria.e1.resourceKey=

# unused variable
sonar.issue.ignore.multicriteria.e2.ruleKey=
sonar.issue.ignore.multicriteria.e2.resourceKey=

# function with too many line
sonar.issue.ignore.multicriteria.e3.ruleKey=
sonar.issue.ignore.multicriteria.e3.resourceKey=

# trailing comma
sonar.issue.ignore.multicriteria.e4.ruleKey=
sonar.issue.ignore.multicriteria.e4.resourceKey=

# === and  !==
sonar.issue.ignore.multicriteria.e5.ruleKey=
sonar.issue.ignore.multicriteria.e5.resourceKey=

# Commented Code
sonar.issue.ignore.multicriteria.e6.ruleKey=
sonar.issue.ignore.multicriteria.e6.resourceKey=

# Nested If Depth
sonar.issue.ignore.multicriteria.e7.ruleKey=
sonar.issue.ignore.multicriteria.e7.resourceKey=

sonar.issue.ignore.multicriteria.e8.ruleKey=
sonar.issue.ignore.multicriteria.e8.resourceKey=

# Trailing Whitespace
sonar.issue.ignore.multicriteria.e9.ruleKey=
sonar.issue.ignore.multicriteria.e9.resourceKey=

# Literal boolean values
sonar.issue.ignore.multicriteria.e10.ruleKey=
sonar.issue.ignore.multicriteria.e10.resourceKey=

# Variables and functions redeclared
sonar.issue.ignore.multicriteria.e11.ruleKey=
sonar.issue.ignore.multicriteria.e11.resourceKey=

# Unused function argument
sonar.issue.ignore.multicriteria.e12.ruleKey=
sonar.issue.ignore.multicriteria.e12.resourceKey=

Hi,

Welcome to the community!

I’ve split your post into a new topic because it’s not clear to me that your question is entirely related to the one where you originally posted.

For a .NET project you don’t need a properties file. Most of the values should be read from the build. If you need to explicitly set additional values, that should be done in the project file.

Regarding your error, you’ve only provided your begin command. Are you passing the analysis token on the end command as well? It’s required in both places.

 
Ann

@ganncamp is there any way to use this project.properties file with .Net global tool? Can I use the props settings like this?
/d:project.settings=“C:\xxxxx\sonar-project.properties”

Hi,

As stated above, that should be done in the project file.

 
Ann