question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OmniSharp fails to start if it reads an unparsesable sln file

See original GitHub issue

Environment data

.NET Command Line Tools (2.1.104)

Product Information:
 Version:            2.1.104
 Commit SHA-1 hash:  48ec687460

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.17134
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.1.104\

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.6
  Build    : 74b1c703813c8910df5b96f304b0f2b78cdf194d

VS Code version: Version 1.23.1 Commit d0182c3417d225529c6d5ad24b7572815d0de9ac Date 2018-05-10T17:11:17.614Z Shell 1.7.12 Renderer 58.0.3029.110 Node 7.9.0 Architecture x64

C# Extension version: ? :S

Steps to reproduce

Make a project directory with some template sln/csproj (useless when not processed) files which are alphabetically before the real (processed template) sln/csproj files. For example:

<projectdir>/AAA/MyProject.template.sln
<projectdir>/BBB/MyProject.sln (this one is generated, the input is MyProject.template.sln)

Omnisharp will use the template instead of the real MyProject.sln file.

Expected behavior

A good working editor instead of only having basic syntax highlighting.

Actual behavior

Facilities like autocomplete does not work outside of the working file because omnisharp is using a template file - which does not contain any useful information - instead of the real Solution File. A workaround is to rename my templates so not to use the SNL or CSPROJ extension. For example rename: MyProject.template.sln -> MyProject.sln.template. In which case omnisharp will ignore the file. I’ve seen other languages make use of choosing a project/xml/sln file from the editor which will be used. Something like that would be pretty nice!

Obliviously this is a very minor issue, especially if you know that renaming the templates will solve it. Just wanted to make a note of it!

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
vramanxcommented, Jun 9, 2018

Along the same lines: how do i set a default sln to use when i point to a folder with multiple slns?

0reactions
rchandecommented, Jun 11, 2018

@vramanx @janaka is working on a PR to contribute that functionality: https://github.com/OmniSharp/omnisharp-vscode/pull/2053

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why can't omnisharp/vscode load this sln file? · Issue #3580
E2E.sln works. Changing to WebJobs.Script.sln throws this error. your 131072x1 screen size is bogus. expect trouble. and nothing happens.
Read more >
OmniSharp failed to start in Visual Studio Code
I open folder with existing MSBuild project (actually from VS 2012) on C# in VSCode (v. 0.10.3) under Kubuntu 15.04. OmniSharp throw error...
Read more >
OmniSharp - .NET and IntelliSense on any platform with your ...
OmniSharp is a set of tooling, editor integrations and libraries that together create an ecosystem that allows you to have a great programming...
Read more >
VS Code Error [SOLVED]
Delete all the VS Project files in your Unity project folder (.csproj, .sln, .vscode folder). Open VS Code, hit Ctrl+Shift+P and type ...
Read more >
Intelisense problem - Ask
Which file can't it find? This error is now appearing in all my projects when I try to open a script. I cannot...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found