OmniSharp IntelliSense doesn't work in Visual Studio Code (Unity) - c#

I was trying to set up VS Code to work with Unity for IntelliSense. I followed the instructions but OmniSharp seems to be misbehaving.
Starting OmniSharp server at 1/21/2023, 4:57:42 PM Target: c:\Users\user\Unity Projects\Kinda Better Minecraft\Kinda Better Minecraft.sln OmniSharp server started. Path: c:\Users\user\.vscode\extensions\ms-dotnettools.csharp-1.25.2-win32-x64\.omnisharp\1.39.2\OmniSharp.exe PID: 7388 [STDERR] 'cmd' is not recognized as an internal or external command, operable program or batch file. [ERROR] Error: OmniSharp server load timed out. Use the 'omnisharp.projectLoadTimeout' setting to override the default delay (one minute).
IntelliSense doesn't work. I could type yifrujniut; and it wouldn't see anything wrong.
I'm on windows if that helps.
I was expecting IntelliSense to work. I tried reinstalling VS Code, reinstalling the .NET SDK but I had no idea what was causing the issue.

Related

Error message related to libICE.so.6 makes code to exit?

While working with avlaonia on Vscode and running it in debug. I get the below error message and the code exits and debug doesn't work.
System.DllNotFoundException: Unable to load shared library 'libICE.so.6' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable:
liblibICE.so.6: cannot open shared object file: No such file or directory
at Avalonia.X11.ICELib.IceAddConnectionWatch(IntPtr watchProc, IntPtr clientData)
at Avalonia.X11.X11PlatformLifetimeEvents..ctor(AvaloniaX11Platform platform) in /_/src/Avalonia.X11/X11PlatformLifetimeEvents.cs:line 56
at Avalonia.X11.AvaloniaX11Platform.Initialize(X11PlatformOptions options) in /_/src/Avalonia.X11/X11Platform.cs:line 71
at Avalonia.AvaloniaX11PlatformExtensions.<>c__0`1.<UseX11>b__0_0() in /_/src/Avalonia.X11/X11Platform.cs:line 279
at Avalonia.Controls.AppBuilderBase`1.Setup() in /_/src/Avalonia.Controls/AppBuilderBase.cs:line 303
at Avalonia.Controls.AppBuilderBase`1.SetupWithLifetime(IApplicationLifetime lifetime)
What does this error means, how can I managed to resolve the issue. This error appears any time I'm trying to run debug.
Try installing the package libice6:
sudo apt install libice6
For context, I just installed Linux Subsystem on Windows with Ubuntu, tried to run an avalonia program and ran into this error. It solved the problem (there was a subsequent missing library so I had to similarly run
sudo apt install libsm6
).
I hope it will help you

Dotnet: Works in VSCode's OWN TERMINAL, but OMNISHARP: 'dotnet.exe' is not recognized

How is this possible?
I installed .net sdk 6.0.405: dotnet-sdk-6.0.405-win-x64.exe
I can in windows terminal and power shell run: dotnet --version: 6.0.405 ✅
I CAN ALSO IN VSCODE IN ITS BUILTIN TERMINAL, run: dotnet --version: 6.0.405 ✅✅
But in the OUTPUT tab, choosing OmniSharp Log from the dropdown, it says:
[ERROR] A .NET 6 SDK for x86_64 was not found. Please install the latest x86_64 SDK from ...
I switched vscode explorer settings to use external terminal.
And this terminal setting to command prompt:
Terminal › Integrated › Default Profile: Windows
The default profile used on Windows. This setting will currently be ignored if either terminal.integrated.shell.windows or terminal.integrated.shellArgs.windows are set.
I have dotnet in the PATH (and it works in terminals and in vscode's terminal)
I restarted vscode, AND REINSTALLED the dotnettools "C# for Visual Studio Code (powered by OmniSharp)" extension. I went to the online store and from the right column under Resources I downloaded the ms-dotnettools.csharp-1.25.2#win32-x64.vsix to make sure I get the right one. And restarted vscode.
I tried this setting:
Omnisharp: Dotnet Path
Specified the path to a dotnet installation to use when "useModernNet" is set to true, instead of the default system one. This only influences the dotnet installation to use for hosting Omnisharp itself. Example: "/home/username/mycustomdotnetdirectory".
C:/Program Files/dotnet/sdk/6.0.405
And this setting:
Omnisharp: Sdk Path
Specifies the path to a .NET SDK installation to use for project loading instead of the highest version installed. Applies when "useModernNet" is set to true. Example: /home/username/dotnet/sdks/6.0.300.
C:/Program Files/dotnet/sdk/6.0.405
And restarted vscode. And now it says:
[ERROR] Error: Command failed: dotnet.exe --version
'dotnet.exe' is not recognized as an internal or external command,
operable program or batch file.
What? W H A T? lol
What could be wrong? Why isn't it saying where it expected to find it and what to do to locate it? Is there a setting to specify the dotnet.exe path to this C# extension? Does it need always-on internet or something? Does it have DRM? Does it need Edge installed? Wtf?🙂
🙃😭 I just need intellisense; and I've wasted 2h, on only microsoft-owned products.
#Microsoft 0/5 stars
Still don't know why it happens, but here's how to solve it:
The problem was from this: I like to keep all my visual studio code extensions as .vsix files locally in folders so I can remember and get them easily & offline. Sensible enough choice, and I had the correct ms-dotnettools.csharp-1.25.2#win32-x64.vsix for my platform.
But in VSCode, when I install this particular extension via VSIX, even though it succeeds, it can't find .net. If you instead install the extension "normally", ie via vscode's own download, it seems vscode does some extra configuration steps while installing, and probably sets the .net paths correctly or something. Because now it works.
So TL;DR: don't install ms-dotnettools.csharp via vsix, it seems bugged. 😶
Would love to see an answer explaining what's wrong / how to actually do via vsix; but I don't have any more time to debug this rn.

C# ScriptTask not working when run through Dtexec or SQL Server

Identical question with no answers.
I have an issue with my SSIS projects where I cannot create a project that has a
Microsoft.ScriptTask in it without encountering some bizarre error messages. The underlying issue is that the content of the Microsoft.ScriptTask doesn't matter. The task can be empty and it will result in an identical error.
All scripts ran within Visual Studio work fine.
I have looked at multiple solutions including:
Checking in your program files to see if the right version of DTExec is being used. As shown in the excerpt, I am indeed using the 150 version aka SQL Server 2019.
Most solutions on this page which include checking that the package version is the same as the currently downloaded version of SQL Server (they are both 2019 version 15) and checking the encryption type of the solution to see if the sensitive data could be at fault.
Reinstalling SSDT.
Running everything as administrator from the CMD that runs DTExec to Visual Studio 2019 which runs the code.
Rebuilding the script task.
As recommended by my senior, checking to see if DTExec was running on 32-bit or 64-bit. (If DTExec launches from Program Files(x86), it is most likely 32-bit. If it launches from Program Files, it is most likely 64-bit). It is indeed running on 64-bit.
Another recommendation was to attempt to run the package through SSMS's Agent Profiler which resulted in the same error.
Checking to see if the .Net Framework version on my computer (through checking the GAC) is the same as the target version of the package. They are both 4.8.
"C:\Program Files\Microsoft SQL Server\150\DTS\Binn\Dtexec.exe" /f "C:\Directory\Documents\SSIS Tests\TEST_PROJECT\Package.dtsx"
Microsoft (R) SQL Server Execute Package Utility
Version 15.0.2000.5 for 64-bit
Copyright (C) 2019 Microsoft. All rights reserved.
Started: 16:35:16
Error: 2022-10-20 16:35:17.17
Code: 0xC001F02A
Source: Sequence Container
Description: Cannot create a task from XML for task "Script Task", type "Microsoft.ScriptTask" due to error 0x80070057 "The parameter is incorrect.".
End Error
Error: 2022-10-20 16:35:17.17
Code: 0xC0010018
Source: Script Task
Description: Failed to load task "Script Task", type "". The contact information for this task is "".
End Error
Error: 2022-10-20 16:35:17.18
Code: 0xC0010026
Source: Script Task
Description: The task has failed to load. The contact information for this task is "".
End Error
Error: 2022-10-20 16:35:17.18
Code: 0xC0024107
Source: Script Task
Description: There were errors during task validation.
End Error
Error: 2022-10-20 16:35:17.18
Code: 0xC0010025
Source: Package
Description: The package cannot execute because it contains tasks that failed to load.
End Error
I hope this is enough information and that someone can help. Thank you.
As per AlwaysLearning's comment, the issue was with my SQL Server installation.
I hadn't downloaded SSIS when I originally installed my SQL Server instance which meant that none of my SSIS packages were running properly.

Upgrading wp8 to wp8.1 silverlight, debugger cannot be launched

I have now had an error with VS2013 and WP8.1 silverlight for a couple of days.
I get a couple of different errors, ..Ensure unlocked screen.., AgHost.exe could not be launched, port is in use by another program and ensure the device is unlocked.
These errors came suddenly after I retarged the solution. I have no compiling errors.
Solution Attempts
Restart PC
Restart program
unregister and reregister the phone
reinstall Update 3
reinstall VS2013
Windows Phone 8 Application crash once its launched AgHost.exe' has exited with code -532265403
Install VS2015 with no luck.
reinstall VS2013 Update 4
Nothing worked. The error is also the same for emulator as well as different devices. I can however get the release mode installed. Break points can be used when using release mode, but I have to Clean, Rebuild and then deploy for every time I want to deploy the application. Further the deploy time has gone up exponentially. Before upgrading I used a maximum of 10 seconds. Now it is above a minute in wait time. :/
Anyone has a solution for this ?
Extra
If I run the solution before upgrade on device or Emulator It spins up with debugger. If then go to the updated WP81, I get a popup with info Something is taking longer then normal and then it crashes with ..Ensure unlocked screen.. :/
Could it be an issue with the differen SDKS?
During a repair of all the SDKs, I found an issue with the event log, which I cleared based on The Event Log File is full
Still no success.
Extra
I cannot spin up the emulator from VS2013, when using the WP8.1 solution, but the wp8.0 solution in the same VS works :S
I found an error in a log file, from:
The errors are:
[0F08:14A8][2015-07-23T09:11:44]: Applying execute package: silverlight5_DRT, action: Repair, path: C:\ProgramData\Package Cache\DEB5078B60B74431E2830831EB48DF129CB32932\packages\Silverlight\5.0_DRT\Silverlight_Developer.exe, arguments: '"C:\ProgramData\Package Cache\DEB5078B60B74431E2830831EB48DF129CB32932\packages\Silverlight\5.0_DRT\Silverlight_Developer.exe" /q /ignorewarnings'
[0F08:14A8][2015-07-23T09:11:45]: Error 0x800705de: Process returned error: 0x5de
[0F08:14A8][2015-07-23T09:11:45]: Error 0x800705de: Failed to execute EXE package.
[0550:0E74][2015-07-23T09:11:45]: Error 0x800705de: Failed to configure per-machine EXE package.
[0550:0E74][2015-07-23T09:11:45]: MUX: Installation size in bytes for package: silverlight5_DRT MaxAppDrive: 0 MaxSysDrive: 0 AppDrive: 0 SysDrive: 0
AND
[0F08:14A8][2015-07-23T09:16:16]: Applying execute package:
{312d9252-c71c-4c84-b171-f4ad46e22098}, action: Repair, path:
C:\ProgramData\Package
Cache{312d9252-c71c-4c84-b171-f4ad46e22098}\VS2012.4.exe, arguments:
'"C:\ProgramData\Package
Cache{312d9252-c71c-4c84-b171-f4ad46e22098}\VS2012.4.exe" -repair
-quiet -burn.related.patch' [0F08:14A8][2015-07-23T09:16:23]: Error 0x80048bc7: Process returned error: 0x80048bc7
[0F08:14A8][2015-07-23T09:16:23]: Error 0x80048bc7: Failed to execute
EXE package. [0550:0E74][2015-07-23T09:16:23]: Error 0x80048bc7:
Failed to configure per-machine EXE package.
Anybody knows what to do with this? The error is coming when I repair Windows Phone SDK 8.0
There was a post-VS2013 update for the Windows Phone 8.1 SDK, some odds that you don't have it installed since you did not need it before. The download location is here.
Getting error messages like "port is in use" when there's no obvious reason why it should be in use and seeing excessive download times is also a very strong selector for your installed anti-malware product getting in the way. No specific advice on how to configure it when we don't know what it might be. You definitely first want to try to temporarily disable it so you can identify it as the source of the problem.
I have no Idea of what is the issue, but creating a new solution and importing the existing projects into a new solution has solved all the issues regarding emulator and debugger an AgHost.
Seems like the upgrade function integrated in the solution did not work properly.

How to Interfacing SWI Prolog to the Visual Studio 2012

I have a program that interfacing SWI-Prolog in Visual Studio. Previously, I used VS2010 (XP) and everything works fine. Then I upgrade my VS to become VS2012 (Win7) and now I have a problem in my code.
When it comes to the following code:
PlEngine.Initialize(param);
it always gives me the following exception message:
The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Can anybody spot what mistake that I made or if possible some modification that I have to do, due to the upgrading process?
Additional information regarding my code:
I used the most updated swiPLCs library (version: 1.1.60301.0)
my 'param' in my code above is: string[] param = { "-q", "-f", #"c:\program files (x86)\pl\"};
I have set the path environment variable to: c:\program files (x86)\pl\ and c:\program files (x86)\pl\bin
I have this setting in my code: Environment.SetEnvironmentVariable("SWI_HOME_DIR", Global.g_prologLocation);
I had the reference to: swiPLcs.dll
I already tried to use the SWIProlog 64 bit, but I still have the same problem
Any help is really appreciated.
Many thanks
I finally got the answer myself.
Unlike VS2010, In VS2012 it seems that you have to add SWI-Prolog package into VS2012.
So add SWI.Prolog package using Nuget.
How?
See: https://nuget.org/packages/SWI.Prolog
And VS2012 will recognize the SWI.Prolog now.
Thanks anyway

Categories