首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么omnisharp不起作用?

为什么omnisharp不起作用?
EN

Stack Overflow用户
提问于 2014-07-28 11:37:33
回答 2查看 4.3K关注 0票数 1

我最近安装了Emacs 24.3.1,我在emacs中安装了使用melpa的软件包omnisharp。

但是,在用C#编程时,我看不到omnisharp对Emacs的任何影响。我还需要安装其他的东西吗?还是我在这里做错了什么?

在编译Omnisharp服务器时,我收到以下错误日志:

代码语言:javascript
复制
/home/pratik/OmniSharpServer/OmniSharp.sln (default targets) ->
(Build target) ->
/home/pratik/OmniSharpServer/OmniSharp.Tests/OmniSharp.Tests.csproj (default         targets) ->
/usr/lib/mono/4.0/Microsoft.CSharp.targets (CoreCompile target) ->

FindUsages/IntegrationTest.cs(39,27): error CS0584: Internal compiler error: Method not found: 'Nancy.Testing.BrowserResponseExtensions.BodyAsXml'.
FindUsages/IntegrationTest.cs(41,20): error CS1061: Type `object' does not contain a definition for `Length' and no extension method `Length' of type `object' could be found (are you missing a using directive or an assembly reference?)
FindUsages/IntegrationTest.cs(42,19): error CS0021: Cannot apply indexing with [] to an expression of type `object'
FindUsages/IntegrationTest.cs(43,19): error CS0021: Cannot apply indexing with [] to an expression of type `object'

 31 Warning(s)
 4 Error(s)
EN

回答 2

Stack Overflow用户

发布于 2014-08-20 17:55:03

我正在运行与您相同的路径(*nix + emacs + omnisharp)。问题的答案是在OmniSharpServer git页面(https://github.com/nosami/OmniSharpServer)中。您的系统上有mono,所以您必须克隆OmniSharpServerRepository并在shell中执行以下行:

代码语言:javascript
复制
git clone https://github.com/nosami/OmniSharpServer.git
cd OmniSharpServer
git submodule update --init --recursive
xbuild

如果xbuild抱怨某些程序集丢失,那么git submodule update --init --recursive就有问题。只要您在底部得到"N错误“消息,您就不会在项目中找到任何二进制文件(exe或dll)。如果您解决了错误,二进制文件应该位于"OmniSharpServer/OmniSharp/bin/Debug“。

您应该在问题中包含完整的编译器输出。如果你还提供了一些关于你的环境的信息,它将更容易帮助你。请在OmniSharpServer目录中执行这一行(我想看看您是否正在查看主分支的最后一个版本,我希望看到您正在使用的mono版本):

代码语言:javascript
复制
git branch -v
mono --version
票数 3
EN

Stack Overflow用户

发布于 2015-03-19 21:32:29

我也犯了同样的错误,并注意到有版本冲突。您需要在Ubuntu上安装mono-devel:

代码语言:javascript
复制
sudo apt-key adv --keyserver pgp.mit.edu --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
sudo echo "deb http://download.mono-project.com/repo/debian wheezy main" > /etc/apt/sources.list.d/mono-xamarin.list
sudo apt-get update
apt-get install mono-devel

完成后,您应该能够启动服务器:

代码语言:javascript
复制
mono OmniSharp/bin/Debug/OmniSharp.exe
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/24994438

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档