Closed ibeckermayer closed 6 years ago
which version of spacemacs are you using? 0.200.x or 0.300.x (develop) ?
the develop/0.300.x version has layer with updated settings.. 0.200.x has an outdated layer
I see! Yes, I've been using 0.200.x. I'll have to confirm that this fixes it once I get to my work computer. If it does, I'll also PR a change in the spacemacs section of the README, since this was a big headache for me yesterday.
@razzmatazz Unfortunately, despite upgrading to 0.300.x the issue persists exactly as before. Anything else I could try? It seems as if it's specific to the company-omnisharp :with company-yasnippet
backend, since it's working in all my other files that don't use this backend. Is there any other information I should give you to help identify the issue?
@ibeckermayer not sure why do you need this (global-company-mode ..
thing? Could you try removing it? I.e. things should work out of the box on spacemacs.
Also, do you get something in *omnisharp-debug*
buffer? Does the server start properly?
@razzmatazz I took out the global company mode thing, but the same issue remains. I don't have an *omnisharp-debug*
buffer but I do have an *ominisharp-log*
buffer whose output is below:
[17:05:45] Starting OmniSharpServer using project folder/solution file: /home/ibeckermayer/Documents/EZTest/EZTest.sln
[17:05:45] Using server binary on /home/ibeckermayer/bin/omnisharp-linux/omnisharp/OmniSharp.exe
[17:05:45] INFORMATION: OmniSharp.Stdio.Host, Starting OmniSharp on ubuntu 16.4 (x64)
[17:05:45] INFORMATION: OmniSharp.MSBuild.Discovery.MSBuildLocator, Located 2 MSBuild instance(s)
1: Mono 15.0 - "/usr/lib/mono/msbuild/15.0/bin"
2: StandAlone 15.0 - "/home/ibeckermayer/bin/omnisharp-linux/omnisharp/msbuild/15.0/Bin"
[17:05:45] INFORMATION: OmniSharp.MSBuild.Discovery.MSBuildLocator, Registered MSBuild instance: Mono 15.0 - "/usr/lib/mono/msbuild/15.0/bin"
CscToolPath = /home/ibeckermayer/bin/omnisharp-linux/omnisharp/msbuild/15.0/Bin/Roslyn
CscToolExe = csc.exe
[17:05:46] INFORMATION: OmniSharp.Cake.CakeProjectSystem, Detecting Cake files in '/home/ibeckermayer/Documents/EZTest'.
[17:05:46] INFORMATION: OmniSharp.Cake.CakeProjectSystem, Could not find any Cake files
[17:05:46] INFORMATION: OmniSharp.DotNet.DotNetProjectSystem, Initializing in /home/ibeckermayer/Documents/EZTest
[17:05:46] INFORMATION: OmniSharp.DotNet.DotNetProjectSystem, Auto package restore: False
[17:05:46] INFORMATION: OmniSharp.DotNet.DotNetProjectSystem, Update workspace context
[17:05:46] INFORMATION: OmniSharp.DotNet.DotNetProjectSystem, Resolving projects references
[17:05:46] INFORMATION: OmniSharp.MSBuild.ProjectSystem, Detecting projects in '/home/ibeckermayer/Documents/EZTest/EZTest.sln'.
[17:05:46] INFORMATION: OmniSharp.Script.ScriptProjectSystem, Detecting CSX files in '/home/ibeckermayer/Documents/EZTest'.
[17:05:46] INFORMATION: OmniSharp.Script.ScriptProjectSystem, Could not find any CSX files
[17:05:46] INFORMATION: OmniSharp.Stdio.Host, Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider
[17:05:46] INFORMATION: OmniSharp.Stdio.Host, Configuration finished.
[17:05:46] INFORMATION: OmniSharp.Stdio.Host, Omnisharp server running using Stdio at location '/home/ibeckermayer/Documents/EZTest' on host -1.
[17:05:48] <-- 1 /typelookup: ((Type) (Documentation) (StructuredDocumentation))
[17:05:48] <-- 2 /autocomplete: []
[17:05:55] <-- 3 /autocomplete: []
Omnisharp was quite an ordeal to get working, but it is now working as far as I can tell. Does anything in that output suggest otherwise?
@ibeckermayer Sorry, I meant omnisharp-log–you were right.
Do you have any .csproj referenced in your .sln file?
It should say something like this on the log:
[11:59:26] INFORMATION: OmniSharp.MSBuild.MSBuildProjectSystem, Loading project: /Users/[....]/Something.csproj
and then down below on the log:
[12:00:42] INFORMATION: OmniSharp.MSBuild.MSBuildProjectSystem, Update project: Something
Could you check your .sln file?
@razzmatazz
Ok now we're getting somewhere. I'm running everything on Ubuntu and have no experience with Microsoft API's. I was able to generate a .sln file using dotnet new sln
, which I figured out I needed because I was getting omnisharp-server errors on spacemacs startup without it. Now it sounds like I need to create a .csproj file as well? I tried it with dotnet new web
, which did create a .csproj file but didn't solve the problem.
There seems to be limited documentation on how to configure everything manually, since most people are working in Visual Studio which appears to take care of most of this stuff behind the scenes. For example, I tried dotnet new web
but it's not clear to me that that's the correct option. When I run dotnet new -l
I have all of these options but I'm unsure of which one to choose for my application:
Templates Short Name Language Tags
--------------------------------------------------------------------------------------------------------
Console Application console [C#], F#, VB Common/Console
Class library classlib [C#], F#, VB Common/Library
Unit Test Project mstest [C#], F#, VB Test/MSTest
xUnit Test Project xunit [C#], F#, VB Test/xUnit
ASP.NET Core Empty web [C#], F# Web/Empty
ASP.NET Core Web App (Model-View-Controller) mvc [C#], F# Web/MVC
ASP.NET Core Web App razor [C#] Web/MVC/Razor Pages
ASP.NET Core with Angular angular [C#] Web/MVC/SPA
ASP.NET Core with React.js react [C#] Web/MVC/SPA
ASP.NET Core with React.js and Redux reactredux [C#] Web/MVC/SPA
ASP.NET Core Web API webapi [C#], F# Web/WebAPI
global.json file globaljson Config
NuGet Config nugetconfig Config
Web Config webconfig Config
Solution File sln Solution
Razor Page page Web/ASP.NET
MVC ViewImports viewimports Web/ASP.NET
MVC ViewStart viewstart Web/ASP.NET
Here are my files:
.csproj:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Folder Include="wwwroot\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.7" />
</ItemGroup>
</Project>
.sln:
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26124.0
MinimumVisualStudioVersion = 15.0.26124.0
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
omnisharp-log
[11:50:18] Starting OmniSharpServer using project folder/solution file: /home/ibeckermayer/Documents/EZTest/EZTest.sln
[11:50:18] Using server binary on /home/ibeckermayer/bin/omnisharp-linux/omnisharp/OmniSharp.exe
[11:50:18] INFORMATION: OmniSharp.Stdio.Host, Starting OmniSharp on ubuntu 16.4 (x64)
[11:50:18] INFORMATION: OmniSharp.MSBuild.Discovery.MSBuildLocator, Located 2 MSBuild instance(s)
1: Mono 15.0 - "/usr/lib/mono/msbuild/15.0/bin"
2: StandAlone 15.0 - "/home/ibeckermayer/bin/omnisharp-linux/omnisharp/msbuild/15.0/Bin"
[11:50:18] INFORMATION: OmniSharp.MSBuild.Discovery.MSBuildLocator, Registered MSBuild instance: Mono 15.0 - "/usr/lib/mono/msbuild/15.0/bin"
CscToolPath = /home/ibeckermayer/bin/omnisharp-linux/omnisharp/msbuild/15.0/Bin/Roslyn
CscToolExe = csc.exe
[11:50:18] INFORMATION: OmniSharp.Cake.CakeProjectSystem, Detecting Cake files in '/home/ibeckermayer/Documents/EZTest'.
[11:50:18] INFORMATION: OmniSharp.Cake.CakeProjectSystem, Could not find any Cake files
[11:50:18] INFORMATION: OmniSharp.DotNet.DotNetProjectSystem, Initializing in /home/ibeckermayer/Documents/EZTest
[11:50:18] INFORMATION: OmniSharp.DotNet.DotNetProjectSystem, Auto package restore: False
[11:50:18] INFORMATION: OmniSharp.DotNet.DotNetProjectSystem, Update workspace context
[11:50:18] INFORMATION: OmniSharp.DotNet.DotNetProjectSystem, Resolving projects references
[11:50:18] INFORMATION: OmniSharp.MSBuild.ProjectSystem, Detecting projects in '/home/ibeckermayer/Documents/EZTest/EZTest.sln'.
[11:50:18] INFORMATION: OmniSharp.Script.ScriptProjectSystem, Detecting CSX files in '/home/ibeckermayer/Documents/EZTest'.
[11:50:18] INFORMATION: OmniSharp.Script.ScriptProjectSystem, Could not find any CSX files
[11:50:18] INFORMATION: OmniSharp.Stdio.Host, Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider
[11:50:18] INFORMATION: OmniSharp.Stdio.Host, Configuration finished.
[11:50:18] INFORMATION: OmniSharp.Stdio.Host, Omnisharp server running using Stdio at location '/home/ibeckermayer/Documents/EZTest' on host -1.
[11:50:21] <-- 1 /typelookup: ((Type) (Documentation) (StructuredDocumentation))
[11:50:22] <-- 2 /typelookup: ((Type) (Documentation) (StructuredDocumentation))
[11:50:23] <-- 3 /typelookup: ((Type) (Documentation) (StructuredDocumentation))
[11:50:25] <-- 4 /autocomplete: []
[11:50:25] <-- 5 /autocomplete: []
[11:50:25] <-- 6 /typelookup: ((Type) (Documentation) (StructuredDocumentation))
you need to add .csproj file to the .sln file so it would load it:
dotnet sln EZTest.sln add EZTest.csproj
Ok perfect, that fixed it! Thanks for bearing with me. Do you know of any tutorials that give you a basic rundown of how to use dotnet
properly?
I am currently unable to get autocomplete to work for csharp layer in spacemacs.
I have the following in my dotspacemacs/user-config:
yet when I go into a .cs file, company autocomplete does not show up at all. The only autocomplete I can get is when I use comments, and then it does not use my default company behavior.
Here is an example of my company-diag output:
Here's an example of the company-diag output on a vhdl file where it is working properly