Error: Failed to connect to OmniSharp - mono

Firstly I have already tried the steps outlined in Getting "Error: Failed to connect to OmniSharp" and followed the directions posted in the reddit post mentioned.
I have installed VSCode on OS X Yosemite and I am getting this error when loading an sln.
Error: Failed to connect to OmniSharp
I understand that OmniSharp comes installed with VSCode, but I also have Mono installed as well as dnvm, aspnet/dnx that was installed using brew.
Could anyone please offer a suggestion? I love the look and feel of VSCode and after reading the docs can tell there is some great features. I have been patiently been waiting to do my c# work on my macbook and really looking forward to being able to try VSCode.
Thanks for any suggestions.
Here is the output from my OmniSharp Log:
Starting OmniSharp at '/Volumes/cca/cca.sln'...
[INFORMATION:OmniSharp.Startup] Omnisharp server running on port '2000' at location '/Volumes/cca' on host 930.
[INFORMATION:OmniSharp.AspNet5.AspNet5Paths] Using runtime '/Users/jayrue/.dnx/runtimes/dnx-mono.1.0.0-beta4'.
[INFORMATION:OmniSharp.AspNet5.AspNet5ProjectSystem] Scanning '/Volumes/cca' for ASP.NET 5 projects
[INFORMATION:OmniSharp.AspNet5.AspNet5ProjectSystem] No project.json based projects found
[INFORMATION:OmniSharp.MSBuild.MSBuildProjectSystem] Detecting projects in '/Volumes/cca/cca.sln'.
[WARNING:OmniSharp.MSBuild.MSBuildProjectSystem] Skipped unsupported project type 'http://localhost:63367'
Here is my sln:
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Express 2013 for Web
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "cca", "http://localhost:63367", "{53236049-2FD4-436E-B20D-8E53D6F9EC7E}"
ProjectSection(WebsiteProperties) = preProject
UseIISExpress = "true"
TargetFrameworkMoniker = ".NETFramework,Version%3Dv2.0"
Debug.AspNetCompiler.VirtualPath = "/localhost_63367"
Debug.AspNetCompiler.PhysicalPath = "E:\inetpub\wwwroot\cca\"
Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_63367\"
Debug.AspNetCompiler.Updateable = "true"
Debug.AspNetCompiler.ForceOverwrite = "true"
Debug.AspNetCompiler.FixedNames = "false"
Debug.AspNetCompiler.Debug = "True"
Release.AspNetCompiler.VirtualPath = "/localhost_63367"
Release.AspNetCompiler.PhysicalPath = "E:\inetpub\wwwroot\cca\"
Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_63367\"
Release.AspNetCompiler.Updateable = "true"
Release.AspNetCompiler.ForceOverwrite = "true"
Release.AspNetCompiler.FixedNames = "false"
Release.AspNetCompiler.Debug = "False"
SlnRelativePath = "E:\inetpub\wwwroot\cca\"
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{53236049-2FD4-436E-B20D-8E53D6F9EC7E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{53236049-2FD4-436E-B20D-8E53D6F9EC7E}.Debug|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

You need project.json file. That is the project file format VSCode understands. It doesn't understand sln format.

For MSBuild workspaces (those with a sln-file) VSCode supports csproj-files. The solution you have posted just point to a WebSite project ({E24C65DC-7377-472B-9ABA-BC803B73C61A}, http://www.codeproject.com/Reference/720512/List-of-Visual-Studio-Project-Type-GUIDs). As mentioned before, an alternative is DNX workspaces with project.json-files.

Try opening the entire project folder instead of the .sln file. Go to File>Open, and instead of going into the project folder, click on it once to select it, and click open. Visual Studio Code will try to automatically load all the related files in that folder.

the OmniSharpServer runs on port 2000, but ycm client use a random port to connect with the server. this is the cause of the failure.
make the following change will fix this issue:
file:
third_party/ycmd/ycmd/completers/cs/cs_completer.py
""" Start the OmniSharp server """
self._logger.info( 'startup' )
- self._omnisharp_port = utils.GetUnusedLocalhostPort()
+ #self._omnisharp_port = utils.GetUnusedLocalhostPort()
+ self._omnisharp_port = 2000
then remove the cs_completer.pyc and try again.

Related

gn: Unresolved dependencies

I'm attempting to build Chromium on Ubuntu 22.04. I've cloned the git repo, checked out the 102.0.5005.59 branch, added the depot_tools directory to PATH, and run
fetch --nohooks chromium
./build/install-build-deps.sh --no-chromeos-fonts
./build/install-build-deps-android.sh --no-chromeos-fonts
gclient runhooks
I then attempted to generate the ninja files by running gn args out/Default and setting
is_debug = false
is_clang = true
symbol_level = 2
dcheck_always_on = false
is_component_build = false
target_os = "android"
target_cpu = "arm64"
blink_symbol_level = 0
v8_symbol_level = 0
ignore_elf32_limitations = true
as the build parameters. However, this failed with
Generating files...
ERROR Unresolved dependencies.
//third_party/androidx:androidx_test_espresso_espresso_contrib_java__classes(//build/toolchain/android:android_clang_arm64)
needs //third_party/android_deps:com_google_android_apps_common_testing_accessibility_framework_accessibility_test_framework_java(//build/toolchain/android:android_clang_arm64)
//third_party/androidx:androidx_test_espresso_espresso_contrib_java__classes__assetres(//build/toolchain/android:android_clang_arm64)
needs //third_party/android_deps:com_google_android_apps_common_testing_accessibility_framework_accessibility_test_framework_java__assetres(//build/toolchain/android:android_clang_arm64)
//third_party/androidx:androidx_test_espresso_espresso_contrib_java__classes__build_config_crbug_908819(//build/toolchain/android:android_clang_arm64)
needs //third_party/android_deps:com_google_android_apps_common_testing_accessibility_framework_accessibility_test_framework_java__build_config_crbug_908819(//build/toolchain/android:android_clang_arm64)
//third_party/androidx:androidx_test_espresso_espresso_contrib_java__classes__dex(//build/toolchain/android:android_clang_arm64)
needs //third_party/android_deps:com_google_android_apps_common_testing_accessibility_framework_accessibility_test_framework_java__header(//build/toolchain/android:android_clang_arm64)
//third_party/androidx:androidx_test_espresso_espresso_contrib_java__classes__dex(//build/toolchain/android:android_clang_arm64)
needs //third_party/android_deps:com_google_android_apps_common_testing_accessibility_framework_accessibility_test_framework_java__impl(//build/toolchain/android:android_clang_arm64)
//third_party/androidx:androidx_test_espresso_espresso_contrib_java__classes__header(//build/toolchain/android:android_clang_arm64)
needs //third_party/android_deps:com_google_android_apps_common_testing_accessibility_framework_accessibility_test_framework_java__header(//build/toolchain/android:android_clang_arm64)
//third_party/androidx:androidx_test_espresso_espresso_contrib_java__classes__process_host(//build/toolchain/android:android_clang_arm64)
needs //third_party/android_deps:com_google_android_apps_common_testing_accessibility_framework_accessibility_test_framework_java__impl(//build/toolchain/android:android_clang_arm64)
//third_party/webrtc_overrides:webrtc_component(//build/toolchain/android:android_clang_arm)
needs //third_party/webrtc/rtc_base:rtc_base_approved(//build/toolchain/android:android_clang_arm)
//third_party/webrtc_overrides:webrtc_component(//build/toolchain/android:android_clang_arm64)
needs //third_party/webrtc/rtc_base:rtc_base_approved(//build/toolchain/android:android_clang_arm64)
//third_party/webrtc_overrides:webrtc_component(//build/toolchain/linux:clang_x64)
needs //third_party/webrtc/rtc_base:rtc_base_approved(//build/toolchain/linux:clang_x64)
What's weird is, if I do the same with the 103.0.5060.22 branch, then everything works perfectly. What am I missing?
Looks like you missed to pull all the third-party dependencies needed for Chromium to compile. You should run the following command after checking out or switching to another branch/version/tag of Chromium as each branch/version/tag could have different versions of third-party dependencies:
gclient sync
Now start the compilation process

Visual Studio 2022 Stopped Pushing to Git

Pushing master Error encountered while pushing branch to the remote repository: Git failed with a fatal error. Git failed with a fatal error. unable to access 'https:/: error setting certificate verify locations: CAfile: C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt CApath: none Failed to push the branch to the remote repository. See the Output window for more details. vs 2022
If you installed (or reinstalled) Visual Studio to, say, the D: drive, the pointer to the certificate will change. Reinstalling Git desktop won't help in this case.
To Fix: Find the old gitconfig file and open (in admin mode) in a suitable editor and change the path(s) to point to where the new installation is (or, in my case, just the drive letter).
C:\Program Files\Git\etc\gitconfig
The file would look something like so:
[diff "astextplain"]
textconv = astextplain
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[http]
sslBackend = openssl
sslCAInfo = C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
[core]
autocrlf = true
fscache = true
symlinks = false
editor = \"C:\\\\Program Files\\\\Microsoft VS Code\\\\bin\\\\code\" --wait
[pull]
rebase = false
[credential]
helper = manager-core
[credential "https://dev.azure.com"]
useHttpPath = true
[init]
defaultBranch = master
After the changes, it would look something like this:
[diff "astextplain"]
textconv = astextplain
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[http]
sslBackend = openssl
sslCAInfo = D:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
[core]
autocrlf = true
fscache = true
symlinks = false
editor = \"D:\\\\Program Files\\\\Microsoft VS Code\\\\bin\\\\code\" --wait
[pull]
rebase = false
[credential]
helper = manager-core
[credential "https://dev.azure.com"]
useHttpPath = true
[init]
defaultBranch = master
A lot of programs (including VS) will install something on the c: drive, and if you had the situation I had (not enough room on C: - so I uninstalled all the space hogging programs and reinstalled onto the D: drive), there is usually some sort of configuration file that points to the new location(s), so, it's a good idea to keep this in mind.
install git https://git-scm.com/download/win again and it will fix the issue.

Running a projetct with IntelliJ gives "Execution failed for task ':npmInstall'." but the same project runs ok when started by command line

I have a jhipster project that runs just fine when started by the command line "./gradlew" (Ubuntu 20.04.3) but when I start the debbug from the IntelliJ (community) it returns the follow message:
What went wrong:
Execution failed for task ':npmInstall'.
A problem occurred starting process 'command 'npm''
And I need to run it on IntelliJ to use breakpoints and debug.
What I have tried:
I have checked the java version on the IntelliJ compiller
I have the PATH's set correct (I can run other projects)
After trying to redefine things, deleting the "node-modules" folder, 'invalidating and restart' on intelliJ and even checking-out the entire project from git, what did the trick was to change the block on build.gradle, from:
if (project.hasProperty("nodeInstall")) {
node {
version = "14.16.0"
npmVersion = "7.8.0"
download = true
}
}
to
node {
version = "14.16.0"
npmVersion = "7.8.0"
download = true
}
That fixed the problem and now I can debbug using intelliJ

Detecting if we are running in dev mode or in production mode in CloudFlare Worker

I need to know in my worker script if it is running using wrangler dev locally
or it is running at cloudflare after wrangelr publish.
Is there an environment variable that tells me that, or a request headers?
Code snippet would be highly appriciated.
Thank you.
There isn't a builtin variable, but you can populate such info yourself by defining environments in your wrangler.toml
For example, if we say the topmost [vars] are meant to be used in production, we can declare another variable set meant to be used in local environment. (the environment name is irrelevant)
type = "webpack"
webpack_config = "webpack.config.js"
# these will be used in production
vars = { WORKER_ENV = "production", SENTRY_ENABLED = true }
[env.local]
# these will be used only when --env=local
vars = { WORKER_ENV = "local", SENTRY_ENABLED = false }
From then on, if you run your worker locally using
wrangler dev --env=local
the value of binding WORKER_ENV will be populated as defined under [env.local.vars].
By the way, the syntax of wrangler.toml above is equivalent to
type = "webpack"
webpack_config = "webpack.config.js"
[vars]
WORKER_ENV = "production"
SENTRY_ENABLED = true
[env]
[env.local]
[env.local.vars]
WORKER_ENV = "local"
SENTRY_ENABLED = false
Which I believe it's easier to understand
I believe there is an official update for this now (as of November 2022):
When developing locally, you can create a .dev.vars file in the
project root which allows you to define variables that will be used
when running wrangler dev or wrangler pages dev, as opposed to using
another environment and [vars] in wrangler.toml.
Cloudflare Workers documentation

Phalcon Dev Tools - Builder doesn't knows where is the models directory

I'm getting "Builder doesn't knows where is the models directory" error when I run the phalcon all-models command in both Command Line and Phalcon Webtools.
Please let me know what am I missing?
My webtools.config.php content
define('PTOOLS_IP', '216.174.134.2');
define('PTOOLSPATH', '/var/www/html/vendor/phalcon/devtools');
My webtools.php content
use Phalcon\Web\Tools;
require 'webtools.config.php';
require PTOOLSPATH . '/scripts/Phalcon/Web/Tools.php';
Tools::main(PTOOLSPATH, PTOOLS_IP);
My config.ini content
[database]
adapter = Mysql
host = localhost
username = test
password = test
dbname = test
[application]
controllersDir = ../app/controllers/
modelsDir = ../app/models/
viewsDir = ../app/views/
pluginsDir = ../app/plugins/
libraryDir = ../app/library/
cacheDir = ../app/cache/
baseUri = /
[models]
metadata.adapter = "Memory"
I have change the modelsDir from ../app/models/ to /../app/models/ but still not working.
ANSWER FOUND:
Going to project root directory and type the command (instructions)
# phalcon all-models --directory /var/www/html/projec_name
I speficied the --directory which is the Base path on which project will be created.
Thank you colburton for helping me debug this problem. Much appreciated.
Going to project root directory and type the command (instructions)
# phalcon all-models --directory /var/www/html/projec_name
I speficied the --directory which is the Base path on which project will be created.
Thank you colburton for helping me debug this problem. Much appreciated.
In the options array you pass to the builder you need to add 'modelsDir' with the correct path.
On this page you can find a video with the webtools. There is a tab for "Configuration", where you can set them.
It is also located in the config.ini under app/config
I am using Phalcon 3. After generating a project with phalcon console tool I encountered this error.
There is an easy way out to resolve this issue. Change the following settings in app/config/config.ini if you have one.
[application]
controllersDir = app/controllers/
modelsDir = app/models/
viewsDir = app/views/
pluginsDir = app/plugins/
libraryDir = app/library/
cacheDir = ../cache/