How to fix: No IntelliSense for .NET Core C# files in VSCode

When using the C# 1.17.1 Visual Studio Code extension, I didn’t get correct IntelliSense for C# files.

There was a problem with Omnisharp. It outputted the error found below.

I also had Visual Studio Community 2017 installed and the Visual Studio Build Tools.

After uninstalling the Visual Studio Build Tools. Visual Studio Code asked me to install necessary build tools, after clicking “Yes” to install, the problem was fixed.

 

Error

Omnisharp error in VSCode: Could not load SDK Resolver. A manifest file exists, but the path to the SDK Resolver DLL file could not be found.

 

 

Starting OmniSharp server at 1/14/2019, 7:44:48 AM

Target: c:\Dev\GitHub\roelvanlisdonk\dev\c#\core\test

 

OmniSharp server started.

Path: C:\Users\roelv\.vscode\extensions\ms-vscode.csharp-1.17.1\.omnisharp\1.32.8\OmniSharp.exe

PID: 17140

 

[info]: OmniSharp.Stdio.Host

Starting OmniSharp on Windows 6.2.9200.0 (x64)

[info]: OmniSharp.Services.DotNetCliService

DotNetPath set to dotnet

[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator

Located 3 MSBuild instance(s)

1: Visual Studio Build Tools 2017 15.9.28307.280 – “C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin”

2: Visual Studio Community 2017 15.9.28307.280 – “C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin”

3: StandAlone 15.0 – “C:\Users\roelv\.vscode\extensions\ms-vscode.csharp-1.17.1\.omnisharp\1.32.8\msbuild\15.0\Bin”

[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator

Registered MSBuild instance: Visual Studio Build Tools 2017 15.9.28307.280 – “C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin”

[info]: OmniSharp.Cake.CakeProjectSystem

Detecting Cake files in ‘c:\Dev\GitHub\roelvanlisdonk\dev\c#\core\test’.

[info]: OmniSharp.Cake.CakeProjectSystem

Could not find any Cake files

[info]: OmniSharp.WorkspaceInitializer

Project system ‘OmniSharp.DotNet.DotNetProjectSystem’ is disabled in the configuration.

[info]: OmniSharp.MSBuild.ProjectSystem

No solution files found in ‘c:\Dev\GitHub\roelvanlisdonk\dev\c#\core\test’

[info]: OmniSharp.MSBuild.ProjectManager

Queue project update for ‘c:\Dev\GitHub\roelvanlisdonk\dev\c#\core\test\core.test.csproj’

[info]: OmniSharp.Script.ScriptProjectSystem

Detecting CSX files in ‘c:\Dev\GitHub\roelvanlisdonk\dev\c#\core\test’.

[info]: OmniSharp.Script.ScriptProjectSystem

Could not find any CSX files

[info]: OmniSharp.WorkspaceInitializer

Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider

[info]: OmniSharp.WorkspaceInitializer

Configuration finished.

[info]: OmniSharp.Stdio.Host

Omnisharp server running using Stdio at location ‘c:\Dev\GitHub\roelvanlisdonk\dev\c#\core\test’ on host 10684.

[info]: OmniSharp.MSBuild.ProjectManager

Loading project: c:\Dev\GitHub\roelvanlisdonk\dev\c#\core\test\core.test.csproj

[warn]: OmniSharp.MSBuild.ProjectManager

Failed to load project file ‘c:\Dev\GitHub\roelvanlisdonk\dev\c#\core\test\core.test.csproj’.

c:\Dev\GitHub\roelvanlisdonk\dev\c#\core\test\core.test.csproj(1,1)

Microsoft.Build.Exceptions.InvalidProjectFileException: Could not load SDK Resolver. A manifest file exists, but the path to the SDK Resolver DLL file could not be found. Manifest file path ‘C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\SdkResolvers\Microsoft.Build.NuGetSdkResolver\Microsoft.Build.NuGetSdkResolver.xml’. SDK resolver path: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\CommonExtensions\Microsoft\NuGet\Microsoft.Build.NuGetSdkResolver.dll c:\Dev\GitHub\roelvanlisdonk\dev\c#\core\test\core.test.csproj

at Microsoft.Build.Shared.ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(Boolean condition, String errorSubCategoryResourceName, BuildEventFileInfo projectFile, Exception innerException, String resourceName, Object[] args)

at Microsoft.Build.BackEnd.SdkResolution.SdkResolverLoader.TryAddAssemblyFromManifest(String pathToManifest, String manifestFolder, List`1 assembliesList, ElementLocation location)

at Microsoft.Build.BackEnd.SdkResolution.SdkResolverLoader.FindPotentialSdkResolvers(String rootFolder, ElementLocation location)

at Microsoft.Build.BackEnd.SdkResolution.SdkResolverLoader.LoadResolvers(LoggingContext loggingContext, ElementLocation location)

at Microsoft.Build.BackEnd.SdkResolution.SdkResolverService.Initialize(LoggingContext loggingContext, ElementLocation location)

at Microsoft.Build.BackEnd.SdkResolution.SdkResolverService.ResolveSdk(Int32 submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, String solutionPath, String projectPath, Boolean interactive)

at Microsoft.Build.BackEnd.SdkResolution.CachingSdkResolverService.<>c__DisplayClass3_0.<ResolveSdk>b__0(String key)

at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)

at Microsoft.Build.BackEnd.SdkResolution.CachingSdkResolverService.ResolveSdk(Int32 submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, String solutionPath, String projectPath, Boolean interactive)

at Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImportsFromUnescapedImportExpressionConditioned(String directoryOfImportingFile, ProjectImportElement importElement, List`1& projects, SdkResult& sdkResult, Boolean throwOnFileNotExistsError)

at Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImports(String directoryOfImportingFile, ProjectImportElement importElement, SdkResult& sdkResult)

at Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement)

at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)

at Microsoft.Build.Evaluation.Evaluator`4.Evaluate(ILoggingService loggingService, BuildEventContext buildEventContext)

at Microsoft.Build.Evaluation.Project.Reevaluate(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)

at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)

at Microsoft.Build.Evaluation.Project.Initialize(IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)

at Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)

at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, IDictionary`2 globalProperties, String toolsVersion)

at OmniSharp.MSBuild.ProjectLoader.EvaluateProjectFileCore(String filePath)

at OmniSharp.MSBuild.ProjectLoader.BuildProject(String filePath)

at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Load(String filePath, ProjectLoader loader)

at OmniSharp.MSBuild.ProjectManager.LoadOrReloadProject(String projectFilePath, Func`1 loader)

 

[fail]: OmniSharp.MSBuild.ProjectManager

Attemped to update project that is not loaded: c:\Dev\GitHub\roelvanlisdonk\dev\c#\core\test\core.test.csproj

 

 

Fix Code Spell Checker extension NOT working in Visual Studio Code

I installed the code spell checker extension for Visual Studio Code https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker.

But the spell checker was not working, the status bar showed an exclamation mark icon.

For some reason the spell checker was disabled in the workspace settings:

After this setting was set to true and the workspace settings json file was saved, the code spell checker started working again.

How to scan a double sided document to one PDF by using the HP Color LaserJet Pro M477fdw

The HP Color LaserJet Pro M477fdw has a document feeder and it is able to scan a double sided (2-sided) document to one PDF leaving the pages as separate pages inside the PDF.

  • Install HP Scan (not HP Easy Scan).
  • Select Source = “Document Feeder if loaded”
  • Select Page Sides = “2 – sided (book)”

 

And now the important part, when clicking on the File Type “PDF” a new screen appears.

 

Make sure you disable / uncheck “Separate file for each scanned page”, then save the settings and scan the document.

The double sided document will be scanned to one PDF file with 2 pages in it.

Note: When you put multiple documents in the document feeder all sides of all pages will now be scanned to one PDF.

 

 

 

 

Having troubles with Angular 6 and node sass on Windows 10 x64?

I was getting all kinds of errors after upgrading my project to Angular 6 on Windows 10 x64, including errors on node sass.
These errors were resolved after I removed the x64 version of Node en installed the Node LTS 10.13.0 x86 (32bits) version on Windows 10 x64.

Errors ng build: Exit status 3221225477.

0 info it worked if it ends with ok

1 verbose cli [ ‘C:\\Program Files\\nodejs\\node.exe’,

1 verbose cli ‘C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js’,

1 verbose cli ‘run’,

1 verbose cli ‘build’ ]

2 info using npm@6.4.1

3 info using node@v10.13.0

4 verbose run-script [ ‘prebuild’, ‘build’, ‘postbuild’ ]

5 info lifecycle entry@0.0.0~prebuild: entry@0.0.0

6 info lifecycle entry@0.0.0~build: entry@0.0.0

7 verbose lifecycle entry@0.0.0~build: unsafe-perm in lifecycle true

8 verbose lifecycle entry@0.0.0~build: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;

C:\Dev\MyProject\node_modules\.bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS\;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;C:\Program Files\dotnet\;C:\Program Files (x86)\dotnet\;C:\Program Files\Java\jdk1.8.0_181\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\;C:\Program Files\nodejs\;C:\Users\roelv\AppData\Local\Microsoft\WindowsApps;C:\Users\roelv\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\roelv\.dotnet\tools;C:\Users\roelv\AppData\Roaming\npm

9 verbose lifecycle entry@0.0.0~build: CWD: C:\Dev\MyProject\gateway-entry

10 silly lifecycle entry@0.0.0~build: Args: [ ‘/d /s /c’,

10 silly lifecycle ‘npm run translationsBuild && npm run lint:fix && ng build’ ]

11 silly lifecycle entry@0.0.0~build: Returned: code: 3221225725 signal: null

12 info lifecycle entry@0.0.0~build: Failed to exec build script

13 verbose stack Error: entry@0.0.0 build: `npm run translationsBuild && npm run lint:fix && ng build`

13 verbose stack Exit status 3221225725

13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)

13 verbose stack at EventEmitter.emit (events.js:182:13)

13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)

13 verbose stack at ChildProcess.emit (events.js:182:13)

13 verbose stack at maybeClose (internal/child_process.js:962:16)

13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)

14 verbose pkgid entry@0.0.0

15 verbose cwd C:\Dev\MyProject

16 verbose Windows_NT 10.0.17134

17 verbose argv “C:\\Program Files\\nodejs\\node.exe” “C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js” “run” “build”

18 verbose node v10.13.0

19 verbose npm v6.4.1

20 error code ELIFECYCLE

21 error errno 3221225725

22 error entry@0.0.0 build: `npm run translationsBuild && npm run lint:fix && ng build`

22 error Exit status npm install node-sass@beta

23 error Failed at the entry@0.0.0 build script.

23 error This is probably not a problem with npm. There is likely additional logging output above.

24 verbose exit [ 3221225725, true ]

Sonar Cloud and Azure DevOps – Fixing [SQ] Task failed with status FAILED

A pull request build in Azure DevOps failed with the error: “[SQ] Task failed with status FAILED”.

This was the only information given, when de build failed.

Luckily, the manual build gave more information:

Error: /home/vsts/work/1/s/gradlew failed with return code: 1

FAILURE: Build failed with an exception.

2018-10-30T10:51:56.3943110Z

2018-10-30T10:51:56.3943526Z * What went wrong:

2018-10-30T10:51:56.3960616Z Execution failed for task ‘:sonarqube’.

2018-10-30T10:51:56.3961713Z > ‘feature/10691-fix-side-menu-not-working]-when-NOT-admin’ is not a valid branch name. It can only contain ‘A-Z’, ‘a-z’, ‘0-9’, ‘-‘, ‘_’, ‘.’, and ‘/’)

The problem was in the branch name, it accidentally contained a “]” character.