SonarQube dotnet core: how to avoid the duplicate guid error without altering the default build task
I will preface this that my current solution to this is very easy but one I do not want to keep implementing.
The Problem
Below you will see an image outlining my current build steps. Each of these contain the default settings, with the Prepare analysis on SonarQube
setup to point to my endpoint.
When I run this, again just default settings, I am presented with the following errors
WARNING: Duplicate ProjectGuid: "00000000-0000-0000-0000-000000000000". The project will not be analyzed by SonarQube. Project file: "D:a1sAPI.Tests.csproj"
WARNING: Duplicate ProjectGuid: "00000000-0000-0000-0000-000000000000". The project will not be analyzed by SonarQube. Project file: "D:a1sAPI.csproj"
This is because the build step for dotnet core, by default, looks for **/*.csproj
using the linked setting (Parameters.RestoreBuildProjects)
- with the update to the csproj format the project guid is no longer stored in the csproj files. What I suspect is happening is that SonarQube just defaults the guids when it finds nothing defaults to 000...
and then throws this error.
The Fix
Unlinking the Path to project(s)
parameter and pointing to **/.*.sln
fixed the issue, because now SonarQube can see the project guids (defined the .sln
)
The Question, finally
After that long winded explanation I am lead to ask if there is a better way to get SonarQube to recognise dotnet core projects.
I do not want to change the default build task every time I create a project to satisfy SonarQube's requirements.
.net-core sonarqube azure-devops azure-pipelines
add a comment |
I will preface this that my current solution to this is very easy but one I do not want to keep implementing.
The Problem
Below you will see an image outlining my current build steps. Each of these contain the default settings, with the Prepare analysis on SonarQube
setup to point to my endpoint.
When I run this, again just default settings, I am presented with the following errors
WARNING: Duplicate ProjectGuid: "00000000-0000-0000-0000-000000000000". The project will not be analyzed by SonarQube. Project file: "D:a1sAPI.Tests.csproj"
WARNING: Duplicate ProjectGuid: "00000000-0000-0000-0000-000000000000". The project will not be analyzed by SonarQube. Project file: "D:a1sAPI.csproj"
This is because the build step for dotnet core, by default, looks for **/*.csproj
using the linked setting (Parameters.RestoreBuildProjects)
- with the update to the csproj format the project guid is no longer stored in the csproj files. What I suspect is happening is that SonarQube just defaults the guids when it finds nothing defaults to 000...
and then throws this error.
The Fix
Unlinking the Path to project(s)
parameter and pointing to **/.*.sln
fixed the issue, because now SonarQube can see the project guids (defined the .sln
)
The Question, finally
After that long winded explanation I am lead to ask if there is a better way to get SonarQube to recognise dotnet core projects.
I do not want to change the default build task every time I create a project to satisfy SonarQube's requirements.
.net-core sonarqube azure-devops azure-pipelines
1
Have you considered creating a template or task group that is configured correctly so you can just use that?
– jessehouwing
Jul 8 '18 at 11:58
@jessehouwing I have and, again, I don't particularly want to do that if there is a simpler way (such as adding an argument to one of the SonarQube tasks, or something else). I feel like SonarQube should support this out of the box / with some configuration otherwise every developer out there will have to do the same as I am.
– Questioning
Jul 8 '18 at 12:07
1
Send them a pull request: github.com/SonarSource/sonar-scanner-vsts
– jessehouwing
Jul 8 '18 at 13:04
You have to create ProjectGuid one using script stackoverflow.com/a/52557954/570598
– Artur Mustafin
Dec 31 '18 at 3:56
@arturMustafin Yes, that is an option but it's not really a prefered one in my opinion.
– Questioning
Jan 9 at 17:33
add a comment |
I will preface this that my current solution to this is very easy but one I do not want to keep implementing.
The Problem
Below you will see an image outlining my current build steps. Each of these contain the default settings, with the Prepare analysis on SonarQube
setup to point to my endpoint.
When I run this, again just default settings, I am presented with the following errors
WARNING: Duplicate ProjectGuid: "00000000-0000-0000-0000-000000000000". The project will not be analyzed by SonarQube. Project file: "D:a1sAPI.Tests.csproj"
WARNING: Duplicate ProjectGuid: "00000000-0000-0000-0000-000000000000". The project will not be analyzed by SonarQube. Project file: "D:a1sAPI.csproj"
This is because the build step for dotnet core, by default, looks for **/*.csproj
using the linked setting (Parameters.RestoreBuildProjects)
- with the update to the csproj format the project guid is no longer stored in the csproj files. What I suspect is happening is that SonarQube just defaults the guids when it finds nothing defaults to 000...
and then throws this error.
The Fix
Unlinking the Path to project(s)
parameter and pointing to **/.*.sln
fixed the issue, because now SonarQube can see the project guids (defined the .sln
)
The Question, finally
After that long winded explanation I am lead to ask if there is a better way to get SonarQube to recognise dotnet core projects.
I do not want to change the default build task every time I create a project to satisfy SonarQube's requirements.
.net-core sonarqube azure-devops azure-pipelines
I will preface this that my current solution to this is very easy but one I do not want to keep implementing.
The Problem
Below you will see an image outlining my current build steps. Each of these contain the default settings, with the Prepare analysis on SonarQube
setup to point to my endpoint.
When I run this, again just default settings, I am presented with the following errors
WARNING: Duplicate ProjectGuid: "00000000-0000-0000-0000-000000000000". The project will not be analyzed by SonarQube. Project file: "D:a1sAPI.Tests.csproj"
WARNING: Duplicate ProjectGuid: "00000000-0000-0000-0000-000000000000". The project will not be analyzed by SonarQube. Project file: "D:a1sAPI.csproj"
This is because the build step for dotnet core, by default, looks for **/*.csproj
using the linked setting (Parameters.RestoreBuildProjects)
- with the update to the csproj format the project guid is no longer stored in the csproj files. What I suspect is happening is that SonarQube just defaults the guids when it finds nothing defaults to 000...
and then throws this error.
The Fix
Unlinking the Path to project(s)
parameter and pointing to **/.*.sln
fixed the issue, because now SonarQube can see the project guids (defined the .sln
)
The Question, finally
After that long winded explanation I am lead to ask if there is a better way to get SonarQube to recognise dotnet core projects.
I do not want to change the default build task every time I create a project to satisfy SonarQube's requirements.
.net-core sonarqube azure-devops azure-pipelines
.net-core sonarqube azure-devops azure-pipelines
asked Jul 8 '18 at 10:06
QuestioningQuestioning
417622
417622
1
Have you considered creating a template or task group that is configured correctly so you can just use that?
– jessehouwing
Jul 8 '18 at 11:58
@jessehouwing I have and, again, I don't particularly want to do that if there is a simpler way (such as adding an argument to one of the SonarQube tasks, or something else). I feel like SonarQube should support this out of the box / with some configuration otherwise every developer out there will have to do the same as I am.
– Questioning
Jul 8 '18 at 12:07
1
Send them a pull request: github.com/SonarSource/sonar-scanner-vsts
– jessehouwing
Jul 8 '18 at 13:04
You have to create ProjectGuid one using script stackoverflow.com/a/52557954/570598
– Artur Mustafin
Dec 31 '18 at 3:56
@arturMustafin Yes, that is an option but it's not really a prefered one in my opinion.
– Questioning
Jan 9 at 17:33
add a comment |
1
Have you considered creating a template or task group that is configured correctly so you can just use that?
– jessehouwing
Jul 8 '18 at 11:58
@jessehouwing I have and, again, I don't particularly want to do that if there is a simpler way (such as adding an argument to one of the SonarQube tasks, or something else). I feel like SonarQube should support this out of the box / with some configuration otherwise every developer out there will have to do the same as I am.
– Questioning
Jul 8 '18 at 12:07
1
Send them a pull request: github.com/SonarSource/sonar-scanner-vsts
– jessehouwing
Jul 8 '18 at 13:04
You have to create ProjectGuid one using script stackoverflow.com/a/52557954/570598
– Artur Mustafin
Dec 31 '18 at 3:56
@arturMustafin Yes, that is an option but it's not really a prefered one in my opinion.
– Questioning
Jan 9 at 17:33
1
1
Have you considered creating a template or task group that is configured correctly so you can just use that?
– jessehouwing
Jul 8 '18 at 11:58
Have you considered creating a template or task group that is configured correctly so you can just use that?
– jessehouwing
Jul 8 '18 at 11:58
@jessehouwing I have and, again, I don't particularly want to do that if there is a simpler way (such as adding an argument to one of the SonarQube tasks, or something else). I feel like SonarQube should support this out of the box / with some configuration otherwise every developer out there will have to do the same as I am.
– Questioning
Jul 8 '18 at 12:07
@jessehouwing I have and, again, I don't particularly want to do that if there is a simpler way (such as adding an argument to one of the SonarQube tasks, or something else). I feel like SonarQube should support this out of the box / with some configuration otherwise every developer out there will have to do the same as I am.
– Questioning
Jul 8 '18 at 12:07
1
1
Send them a pull request: github.com/SonarSource/sonar-scanner-vsts
– jessehouwing
Jul 8 '18 at 13:04
Send them a pull request: github.com/SonarSource/sonar-scanner-vsts
– jessehouwing
Jul 8 '18 at 13:04
You have to create ProjectGuid one using script stackoverflow.com/a/52557954/570598
– Artur Mustafin
Dec 31 '18 at 3:56
You have to create ProjectGuid one using script stackoverflow.com/a/52557954/570598
– Artur Mustafin
Dec 31 '18 at 3:56
@arturMustafin Yes, that is an option but it's not really a prefered one in my opinion.
– Questioning
Jan 9 at 17:33
@arturMustafin Yes, that is an option but it's not really a prefered one in my opinion.
– Questioning
Jan 9 at 17:33
add a comment |
2 Answers
2
active
oldest
votes
$paths = Get-ChildItem -include *.csproj -Recurse
foreach($pathobject in $paths)
{
$path = $pathobject.fullname
$doc = New-Object System.Xml.XmlDocument
$doc.Load($path)
$child = $doc.CreateElement("ProjectGuid")
$child.InnerText = [guid]::NewGuid().ToString().ToUpper()
$node = $doc.SelectSingleNode("//Project/PropertyGroup")
$node.AppendChild($child)
$doc.Save($path)
}
add a comment |
The simplest approach is to create a build template as @jessehouwing suggests.
The comments in this SO question explain why SonarQube needs a stable unique id for each project. There isn't currently a flag you can pass to the tasks to tell the Scanner for MSBuild to use an alternative identity if there isn't a project guid. It also isn't obvious what could be used as an alternative id: the file path to the project isn't stable, and the project name isn't guaranteed to be unique and can change so it isn't stable either.
FYI the SonarCloud extension for VSTS now includes a minimal template for .NET Core projects to help new users try out analysing projects. That template has the build parameter set to **/*.sln
, and some of the non-essential build steps removed (e.g. publishing artefacts). It's intended to allow new users to try out analysing code without having to set up any machines and with a minimum of configuration (i.e. using VSTS + SonarCloud + hosted build agent as described in this HOL).
We didn't add templates to the SonarQube extension because that's not a zero-installation option, and adding a template didn't seem to add much value. If you think it would be useful, you could make a suggestion on the SonarSource Community forum.
The easiest option to me would be to add a flag and an pointer to the solution file in thePrepare analysis
step. That way SonarQube can have an idea of the project id's. Something likeIs dotnet core
if yes you add the solution file pointer. Sonarcloud costs far more than the self hosted option so isn't something I can consider.
– Questioning
Jul 9 '18 at 11:47
That doesn't sound any quicker or easier than changing the build definition to build */.sln, and is less discoverable. BTW why do you need to unlink the build parameter? Why not just edit the parameter at process level to use */.sln instead?
– duncanp
Jul 10 '18 at 7:10
It is just as easy, and more importantly it is a configuration setting on SonarQube rather than a configuration setting on a default task for dotnet core. I can't provide any evidence for this but I suspect most people are fine with the defaults and don't change them - I feel like the solution should be something that does not rely on another task being configured correctly for it to function, but I'm probably being pedantic. Changing the parameter would work, but my point about configuration still stands.
– Questioning
Jul 10 '18 at 9:59
1
I agree it would be better if it wasn't necessary to change the task defaults. However, I think adding another setting etc would generate more support issues than it would remove.
– duncanp
Jul 10 '18 at 12:06
1
You could be right. I'll speak to my team and see what we want to do with this info. Thanks for the options.
– Questioning
Jul 10 '18 at 13:33
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51230892%2fsonarqube-dotnet-core-how-to-avoid-the-duplicate-guid-error-without-altering-th%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$paths = Get-ChildItem -include *.csproj -Recurse
foreach($pathobject in $paths)
{
$path = $pathobject.fullname
$doc = New-Object System.Xml.XmlDocument
$doc.Load($path)
$child = $doc.CreateElement("ProjectGuid")
$child.InnerText = [guid]::NewGuid().ToString().ToUpper()
$node = $doc.SelectSingleNode("//Project/PropertyGroup")
$node.AppendChild($child)
$doc.Save($path)
}
add a comment |
$paths = Get-ChildItem -include *.csproj -Recurse
foreach($pathobject in $paths)
{
$path = $pathobject.fullname
$doc = New-Object System.Xml.XmlDocument
$doc.Load($path)
$child = $doc.CreateElement("ProjectGuid")
$child.InnerText = [guid]::NewGuid().ToString().ToUpper()
$node = $doc.SelectSingleNode("//Project/PropertyGroup")
$node.AppendChild($child)
$doc.Save($path)
}
add a comment |
$paths = Get-ChildItem -include *.csproj -Recurse
foreach($pathobject in $paths)
{
$path = $pathobject.fullname
$doc = New-Object System.Xml.XmlDocument
$doc.Load($path)
$child = $doc.CreateElement("ProjectGuid")
$child.InnerText = [guid]::NewGuid().ToString().ToUpper()
$node = $doc.SelectSingleNode("//Project/PropertyGroup")
$node.AppendChild($child)
$doc.Save($path)
}
$paths = Get-ChildItem -include *.csproj -Recurse
foreach($pathobject in $paths)
{
$path = $pathobject.fullname
$doc = New-Object System.Xml.XmlDocument
$doc.Load($path)
$child = $doc.CreateElement("ProjectGuid")
$child.InnerText = [guid]::NewGuid().ToString().ToUpper()
$node = $doc.SelectSingleNode("//Project/PropertyGroup")
$node.AppendChild($child)
$doc.Save($path)
}
answered Dec 31 '18 at 3:57
Artur MustafinArtur Mustafin
1,779917
1,779917
add a comment |
add a comment |
The simplest approach is to create a build template as @jessehouwing suggests.
The comments in this SO question explain why SonarQube needs a stable unique id for each project. There isn't currently a flag you can pass to the tasks to tell the Scanner for MSBuild to use an alternative identity if there isn't a project guid. It also isn't obvious what could be used as an alternative id: the file path to the project isn't stable, and the project name isn't guaranteed to be unique and can change so it isn't stable either.
FYI the SonarCloud extension for VSTS now includes a minimal template for .NET Core projects to help new users try out analysing projects. That template has the build parameter set to **/*.sln
, and some of the non-essential build steps removed (e.g. publishing artefacts). It's intended to allow new users to try out analysing code without having to set up any machines and with a minimum of configuration (i.e. using VSTS + SonarCloud + hosted build agent as described in this HOL).
We didn't add templates to the SonarQube extension because that's not a zero-installation option, and adding a template didn't seem to add much value. If you think it would be useful, you could make a suggestion on the SonarSource Community forum.
The easiest option to me would be to add a flag and an pointer to the solution file in thePrepare analysis
step. That way SonarQube can have an idea of the project id's. Something likeIs dotnet core
if yes you add the solution file pointer. Sonarcloud costs far more than the self hosted option so isn't something I can consider.
– Questioning
Jul 9 '18 at 11:47
That doesn't sound any quicker or easier than changing the build definition to build */.sln, and is less discoverable. BTW why do you need to unlink the build parameter? Why not just edit the parameter at process level to use */.sln instead?
– duncanp
Jul 10 '18 at 7:10
It is just as easy, and more importantly it is a configuration setting on SonarQube rather than a configuration setting on a default task for dotnet core. I can't provide any evidence for this but I suspect most people are fine with the defaults and don't change them - I feel like the solution should be something that does not rely on another task being configured correctly for it to function, but I'm probably being pedantic. Changing the parameter would work, but my point about configuration still stands.
– Questioning
Jul 10 '18 at 9:59
1
I agree it would be better if it wasn't necessary to change the task defaults. However, I think adding another setting etc would generate more support issues than it would remove.
– duncanp
Jul 10 '18 at 12:06
1
You could be right. I'll speak to my team and see what we want to do with this info. Thanks for the options.
– Questioning
Jul 10 '18 at 13:33
add a comment |
The simplest approach is to create a build template as @jessehouwing suggests.
The comments in this SO question explain why SonarQube needs a stable unique id for each project. There isn't currently a flag you can pass to the tasks to tell the Scanner for MSBuild to use an alternative identity if there isn't a project guid. It also isn't obvious what could be used as an alternative id: the file path to the project isn't stable, and the project name isn't guaranteed to be unique and can change so it isn't stable either.
FYI the SonarCloud extension for VSTS now includes a minimal template for .NET Core projects to help new users try out analysing projects. That template has the build parameter set to **/*.sln
, and some of the non-essential build steps removed (e.g. publishing artefacts). It's intended to allow new users to try out analysing code without having to set up any machines and with a minimum of configuration (i.e. using VSTS + SonarCloud + hosted build agent as described in this HOL).
We didn't add templates to the SonarQube extension because that's not a zero-installation option, and adding a template didn't seem to add much value. If you think it would be useful, you could make a suggestion on the SonarSource Community forum.
The easiest option to me would be to add a flag and an pointer to the solution file in thePrepare analysis
step. That way SonarQube can have an idea of the project id's. Something likeIs dotnet core
if yes you add the solution file pointer. Sonarcloud costs far more than the self hosted option so isn't something I can consider.
– Questioning
Jul 9 '18 at 11:47
That doesn't sound any quicker or easier than changing the build definition to build */.sln, and is less discoverable. BTW why do you need to unlink the build parameter? Why not just edit the parameter at process level to use */.sln instead?
– duncanp
Jul 10 '18 at 7:10
It is just as easy, and more importantly it is a configuration setting on SonarQube rather than a configuration setting on a default task for dotnet core. I can't provide any evidence for this but I suspect most people are fine with the defaults and don't change them - I feel like the solution should be something that does not rely on another task being configured correctly for it to function, but I'm probably being pedantic. Changing the parameter would work, but my point about configuration still stands.
– Questioning
Jul 10 '18 at 9:59
1
I agree it would be better if it wasn't necessary to change the task defaults. However, I think adding another setting etc would generate more support issues than it would remove.
– duncanp
Jul 10 '18 at 12:06
1
You could be right. I'll speak to my team and see what we want to do with this info. Thanks for the options.
– Questioning
Jul 10 '18 at 13:33
add a comment |
The simplest approach is to create a build template as @jessehouwing suggests.
The comments in this SO question explain why SonarQube needs a stable unique id for each project. There isn't currently a flag you can pass to the tasks to tell the Scanner for MSBuild to use an alternative identity if there isn't a project guid. It also isn't obvious what could be used as an alternative id: the file path to the project isn't stable, and the project name isn't guaranteed to be unique and can change so it isn't stable either.
FYI the SonarCloud extension for VSTS now includes a minimal template for .NET Core projects to help new users try out analysing projects. That template has the build parameter set to **/*.sln
, and some of the non-essential build steps removed (e.g. publishing artefacts). It's intended to allow new users to try out analysing code without having to set up any machines and with a minimum of configuration (i.e. using VSTS + SonarCloud + hosted build agent as described in this HOL).
We didn't add templates to the SonarQube extension because that's not a zero-installation option, and adding a template didn't seem to add much value. If you think it would be useful, you could make a suggestion on the SonarSource Community forum.
The simplest approach is to create a build template as @jessehouwing suggests.
The comments in this SO question explain why SonarQube needs a stable unique id for each project. There isn't currently a flag you can pass to the tasks to tell the Scanner for MSBuild to use an alternative identity if there isn't a project guid. It also isn't obvious what could be used as an alternative id: the file path to the project isn't stable, and the project name isn't guaranteed to be unique and can change so it isn't stable either.
FYI the SonarCloud extension for VSTS now includes a minimal template for .NET Core projects to help new users try out analysing projects. That template has the build parameter set to **/*.sln
, and some of the non-essential build steps removed (e.g. publishing artefacts). It's intended to allow new users to try out analysing code without having to set up any machines and with a minimum of configuration (i.e. using VSTS + SonarCloud + hosted build agent as described in this HOL).
We didn't add templates to the SonarQube extension because that's not a zero-installation option, and adding a template didn't seem to add much value. If you think it would be useful, you could make a suggestion on the SonarSource Community forum.
answered Jul 9 '18 at 8:55
duncanpduncanp
87948
87948
The easiest option to me would be to add a flag and an pointer to the solution file in thePrepare analysis
step. That way SonarQube can have an idea of the project id's. Something likeIs dotnet core
if yes you add the solution file pointer. Sonarcloud costs far more than the self hosted option so isn't something I can consider.
– Questioning
Jul 9 '18 at 11:47
That doesn't sound any quicker or easier than changing the build definition to build */.sln, and is less discoverable. BTW why do you need to unlink the build parameter? Why not just edit the parameter at process level to use */.sln instead?
– duncanp
Jul 10 '18 at 7:10
It is just as easy, and more importantly it is a configuration setting on SonarQube rather than a configuration setting on a default task for dotnet core. I can't provide any evidence for this but I suspect most people are fine with the defaults and don't change them - I feel like the solution should be something that does not rely on another task being configured correctly for it to function, but I'm probably being pedantic. Changing the parameter would work, but my point about configuration still stands.
– Questioning
Jul 10 '18 at 9:59
1
I agree it would be better if it wasn't necessary to change the task defaults. However, I think adding another setting etc would generate more support issues than it would remove.
– duncanp
Jul 10 '18 at 12:06
1
You could be right. I'll speak to my team and see what we want to do with this info. Thanks for the options.
– Questioning
Jul 10 '18 at 13:33
add a comment |
The easiest option to me would be to add a flag and an pointer to the solution file in thePrepare analysis
step. That way SonarQube can have an idea of the project id's. Something likeIs dotnet core
if yes you add the solution file pointer. Sonarcloud costs far more than the self hosted option so isn't something I can consider.
– Questioning
Jul 9 '18 at 11:47
That doesn't sound any quicker or easier than changing the build definition to build */.sln, and is less discoverable. BTW why do you need to unlink the build parameter? Why not just edit the parameter at process level to use */.sln instead?
– duncanp
Jul 10 '18 at 7:10
It is just as easy, and more importantly it is a configuration setting on SonarQube rather than a configuration setting on a default task for dotnet core. I can't provide any evidence for this but I suspect most people are fine with the defaults and don't change them - I feel like the solution should be something that does not rely on another task being configured correctly for it to function, but I'm probably being pedantic. Changing the parameter would work, but my point about configuration still stands.
– Questioning
Jul 10 '18 at 9:59
1
I agree it would be better if it wasn't necessary to change the task defaults. However, I think adding another setting etc would generate more support issues than it would remove.
– duncanp
Jul 10 '18 at 12:06
1
You could be right. I'll speak to my team and see what we want to do with this info. Thanks for the options.
– Questioning
Jul 10 '18 at 13:33
The easiest option to me would be to add a flag and an pointer to the solution file in the
Prepare analysis
step. That way SonarQube can have an idea of the project id's. Something like Is dotnet core
if yes you add the solution file pointer. Sonarcloud costs far more than the self hosted option so isn't something I can consider.– Questioning
Jul 9 '18 at 11:47
The easiest option to me would be to add a flag and an pointer to the solution file in the
Prepare analysis
step. That way SonarQube can have an idea of the project id's. Something like Is dotnet core
if yes you add the solution file pointer. Sonarcloud costs far more than the self hosted option so isn't something I can consider.– Questioning
Jul 9 '18 at 11:47
That doesn't sound any quicker or easier than changing the build definition to build */.sln, and is less discoverable. BTW why do you need to unlink the build parameter? Why not just edit the parameter at process level to use */.sln instead?
– duncanp
Jul 10 '18 at 7:10
That doesn't sound any quicker or easier than changing the build definition to build */.sln, and is less discoverable. BTW why do you need to unlink the build parameter? Why not just edit the parameter at process level to use */.sln instead?
– duncanp
Jul 10 '18 at 7:10
It is just as easy, and more importantly it is a configuration setting on SonarQube rather than a configuration setting on a default task for dotnet core. I can't provide any evidence for this but I suspect most people are fine with the defaults and don't change them - I feel like the solution should be something that does not rely on another task being configured correctly for it to function, but I'm probably being pedantic. Changing the parameter would work, but my point about configuration still stands.
– Questioning
Jul 10 '18 at 9:59
It is just as easy, and more importantly it is a configuration setting on SonarQube rather than a configuration setting on a default task for dotnet core. I can't provide any evidence for this but I suspect most people are fine with the defaults and don't change them - I feel like the solution should be something that does not rely on another task being configured correctly for it to function, but I'm probably being pedantic. Changing the parameter would work, but my point about configuration still stands.
– Questioning
Jul 10 '18 at 9:59
1
1
I agree it would be better if it wasn't necessary to change the task defaults. However, I think adding another setting etc would generate more support issues than it would remove.
– duncanp
Jul 10 '18 at 12:06
I agree it would be better if it wasn't necessary to change the task defaults. However, I think adding another setting etc would generate more support issues than it would remove.
– duncanp
Jul 10 '18 at 12:06
1
1
You could be right. I'll speak to my team and see what we want to do with this info. Thanks for the options.
– Questioning
Jul 10 '18 at 13:33
You could be right. I'll speak to my team and see what we want to do with this info. Thanks for the options.
– Questioning
Jul 10 '18 at 13:33
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51230892%2fsonarqube-dotnet-core-how-to-avoid-the-duplicate-guid-error-without-altering-th%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Have you considered creating a template or task group that is configured correctly so you can just use that?
– jessehouwing
Jul 8 '18 at 11:58
@jessehouwing I have and, again, I don't particularly want to do that if there is a simpler way (such as adding an argument to one of the SonarQube tasks, or something else). I feel like SonarQube should support this out of the box / with some configuration otherwise every developer out there will have to do the same as I am.
– Questioning
Jul 8 '18 at 12:07
1
Send them a pull request: github.com/SonarSource/sonar-scanner-vsts
– jessehouwing
Jul 8 '18 at 13:04
You have to create ProjectGuid one using script stackoverflow.com/a/52557954/570598
– Artur Mustafin
Dec 31 '18 at 3:56
@arturMustafin Yes, that is an option but it's not really a prefered one in my opinion.
– Questioning
Jan 9 at 17:33