Introduction
This tip intended to resolve the possible issues in installing and executing the VS Code and .NET Core SDK 2.0 behind corporate proxy.
Steps
Install .NET Core SDK 2.0 and VS Code:
As stated in these articles 1, 2, the installation process from the command line is not detecting proxy settings properly. So if you are executing behind corporate proxy, the required dependencies: OmniSharp and .NET Core Debugger may fail to install.
Updating C# dependencies...
Platform: win32, x86_64
Downloading package 'OmniSharp (.NET 4.6 / x64)' (15684 KB) .................... Done!
Downloading package '.NET Core Debugger (Windows / x64)' (43510 KB) .................... Done!
Installing package 'OmniSharp (.NET 4.6 / x64)'
Installing package '.NET Core Debugger (Windows / x64)'
Failed at stage: installPackages
Error: end of central directory record signature not found
Finished
In order to resolve this problem, you need to install the dependencies manually.
- The default location of VS Code extensions is "%USERPROFILE%.vscode\extensions\"
- One of the extension is CSharp "ms-vscode.csharp-<version>". The run time dependencies are specified with in package.json file.
"runtimeDependencies": [
{
"description": "OmniSharp for Windows (.NET 4.6 / x86)",
"url": "https://download.visualstudio.microsoft.com/download/pr/
11114591/53def2e097a7e2c1a8bf567c6d81ad7a/omnisharp-win-x86-1.23.2.zip",
"fallbackUrl": "https://omnisharpdownload.blob.core.windows.net/ext/omnisharp-win-x86-1.23.2.zip",
"installPath": ".omnisharp",
"platforms": [
"win32"
],
"architectures": [
"x86"
],
"installTestPath": "./.omnisharp/OmniSharp.exe"
},
{
"description": ".NET Core Debugger (Windows / x64)",
"url": "https://download.visualstudio.microsoft.com/download/pr/10975649/
e7e53245607ac00f315a629e2ed934b9/coreclr-debug-win7-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-12-5/
coreclr-debug-win7-x64.zip",
"installPath": ".debugger",
"platforms": [
"win32"
],
"architectures": [
"x86_64"
],
"installTestPath": "./.debugger/vsdbg-ui.exe"
},
Points of Interest
Even after the successful installation of dependencies, the project may fail to execute. You may get error "Could not find the preLaunch task 'build'".
- If you are encountering this issue, just delete the ".vscode" folder within the solution workspace folder.
- Reload the VS code and hit F5 (Debug).
- When VS Code asks to select type of debugging needed, just press "Escape" key without selecting any debugger.
- VS Code will detect the project and created necessary support files automatically.
- Next time, your project will run without any issues.
Reference
History
- 2017/10/10 - Initial version