Please create a separate topic for each question, as it makes them easier to answer.
Local build error:
The error message is saying that the runtime can’t find the scanner, which suggests that either it isn’t installed correctly, or you have installed locally (rather than globally) in a different folder from where you are trying to execute it.
You can use the dotnet tool list --global and dotnet tool list --local commands to check if the scanner is installed correctly.
CI build error:
MSBUILD: error MSB1003: Specify a project or solution file. The current working directory does not contain a project or solution file.
This has nothing to do with the scanner, it’s an error in the “build” part of your pipeline. MSBuild can’t find a project/solution to build.