简体   繁体   中英

Omnisharp sublime text errors with ASP.NET 5.0 MVC6

I'm using the new asp.net mvc via github here: https://github.com/aspnet/home and I installed the Omnisharp package for Sublime Text 3 to get C# autocomplete. I am attempting to run the HelloMvc project, which works fine when I run k kestrel and then open http://localhost:5004/

However, a bit of annoyance is when I save a file (for example, HomeController.cs) and then Sublime Text console opens and gives me the following errors:

Error : Unknown Resolver Error - (1, 23)
Error : '?' does not contain a definition for 'Mvc' - (1, 27)
Error : 'Controller' is not a known identifier - (6, 45)
Error : 'IActionResult' is not a known identifier - (8, 29)
Error : 'View' is not a known identifier - (10, 24)
Error : 'HomeController' does not contain a definition for 'View' - (10, 32)

And then it give me swigglies under the matching lines. I would like whatever the feature is that is ensuring it is good code, however, is there a way to change the settings so that it recognizes this is all valid?

Or does Omnisharp not yet support the new way asp.net 5.0 handles external packages?

The current packaged version of omnisharp-sublime is using the omnisharp-server backend (NRefactory based), not omnisharp-roslyn (Roslyn based and support for Asp.Net 5 projects).

Work is ongoing both on omnisharp-roslyn, and the sublime plugin to make things work https://github.com/OmniSharp/omnisharp-sublime/tree/roslyn

I haven't tried it out yet (I'm an emacs guy), but from what I've heard, it's working really well! I use emacs with the omnisharp-roslyn server to develop omnisharp-roslyn with (the server itself is an Asp.Net 5 solution https://github.com/OmniSharp/omnisharp-roslyn )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM