Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

security-scan /your/solution.sln throws up error. #275

Open
misterraj7 opened this issue Dec 8, 2022 · 5 comments
Open

security-scan /your/solution.sln throws up error. #275

misterraj7 opened this issue Dec 8, 2022 · 5 comments

Comments

@misterraj7
Copy link

misterraj7 commented Dec 8, 2022

PS C:\Users\jvraj\Downloads\New folder> dotnet tool install --global security-scan --version 5.6.7
Tool 'security-scan' is already installed.
PS C:\Users\jvraj\Downloads\New folder> security-scan webgoat.net.sln

╔═╗┌─┐┌─┐┬ ┬┬─┐┬┌┬┐┬ ┬ ╔═╗┌─┐┌┬┐┌─┐ ╔═╗┌─┐┌─┐┌┐┌
╚═╗├┤ │ │ │├┬┘│ │ └┬┘ ║ │ │ ││├┤ ╚═╗│ ├─┤│││
╚═╝└─┘└─┘└─┘┴└─┴ ┴ ┴ ╚═╝└─┘─┴┘└─┘ ╚═╝└─┘┴ ┴┘└┘

.NET tool by Jaroslav Lobačevski v5.6.7

Loading solution 'webgoat.net.sln'
Msbuild failed when processing the file 'C:\Users\jvraj\Downloads\New folder\WebGoat\WebGoat.NET.csproj' with message: The imported project "C:\Program Files\dotnet\sdk\6.0.302\Microsoft\VisualStudio\v17.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the expression in the Import declaration "C:\Program Files\dotnet\sdk\6.0.302\Microsoft\VisualStudio\v17.0\WebApplications\Microsoft.WebApplication.targets" is correct, and that the file exists on disk. C:\Users\jvraj\Downloads\New folder\WebGoat\WebGoat.NET.csproj
Finished loading solution 'webgoat.net.sln'
PS C:\Users\jvraj\Downloads\New folder>

I am using visual studio 17.2.6

@kevinneumann
Copy link

I am having a similar issue. I can use the --ignore-msbuild-errors flag but that seems to just skip the project from being scanned. Looking for a better solution.

@ThomasFrey
Copy link

I ran into this as well. Seems like any item the solution/project that uses $(VSToolsPath) will try to go to "C:\Program Files\dotnet\sdk\6.0.302\Microsoft\VisualStudio\v17.0" instead of the correct location.

@nbelley
Copy link

nbelley commented Jun 28, 2023

Any other ideas for this?

@BenMakesGames
Copy link

BenMakesGames commented Jun 29, 2023

I'm also unable to run the tool, getting a similar error:

Msbuild failed when processing the file 'C:\progs\laser\src\API\API.csproj' with message: C:\Program Files\dotnet\sdk\6.0.408\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets: (144, 5): The current .NET SDK does not support targeting .NET 7.0. Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 7.0.

I'm not sure why .NET 6 is being referenced at all; this is a .NET 7 project; we even have a global.json which requires 7.0.304 for our project. (and I have the 7.0.304 SDK installed, of course. I do also have a version of 6 installed; haven't tried uninstalling it, as it's needed for another project I work on.)

other info:

  • we are not using $(VSToolsPath)
  • I tried deleting the global.json, just in case that was doing something?? doing so had no apparent effect; the issue remained

@camsilver
Copy link

Causing issue with Azure Pipeline as well
Ran into simular issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants