Linux 是否可以使用 Mono (Mac) 运行 LINQPad

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3681950/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-04 21:45:13  来源:igfitidea点击:

Is it possible to run LINQPad with Mono (Mac)

linuxdockermonolinqpadwindows-subsystem-for-linux

提问by kwcto

I have installed Mono 2.6.7 in Snow Leopard and would like to run LINQPad. I've gotten LINQPad (v2.21) to start but immediately get a FileNotFoundException. Has anyone been able to run it successfully?

我已经在 Snow Leopard 中安装了 Mono 2.6.7 并且想要运行 LINQPad。我已经让 LINQPad (v2.21) 启动,但立即收到 FileNotFoundException。有没有人能够成功运行它?

I assume the exception is because it's trying to read/write a config file or something but hopefully there is some workaround.

我认为异常是因为它正在尝试读取/写入配置文件或其他内容,但希望有一些解决方法。

Thanks.

谢谢。

Edit: Building Mono with "Olive" (required for WPF):

编辑:使用“Olive”构建 Mono(WPF 需要):

In Terminal:

在终端:

svn co svn://anonsvn.mono-project.com/source/trunk/olive
cd /Users/(your user name)/olive
./configure --prefix=/Users/(your user name)/olive --with-glib=embedded
make
make install

Now navigate in Finder to:

现在在 Finder 中导航到:

/Users/(your user name)/olive/lib/mono/gac

/Users/(您的用户名)/olive/lib/mono/gac

Copy those folders (ex: PresentationCore, PresentationFramework) into:

将这些文件夹(例如:PresentationCore、PresentationFramework)复制到:

/Library/Frameworks/Mono.framework/Versions/2.6.7/lib/mono/gac (Current Mono version is 2.6.7 but this obviously may be different)

/Library/Frameworks/Mono.framework/Versions/2.6.7/lib/mono/gac(当前 Mono 版本是 2.6.7,但这显然可能不同)

Edit:Unfortunately, now I'm getting this when running LINQPad:

编辑:不幸的是,现在我在运行 LINQPad 时得到了这个:

WARNING **: The class System.Windows.Resources.AssemblyAssociatedContentFileAttribute could not be loaded, used in LINQPadcould not be loaded, used in LINQPad

警告**:类 System.Windows.Resources.AssemblyAssociatedContentFileAttribute 无法加载,在 LINQPad 中使用无法加载,在 LINQPad 中使用

Edit:Xamarin Workbooks recently released 1.0 (https://developer.xamarin.com/workbooks/) and is the closest I've seen to LINQPad on macOS.

编辑:Xamarin Workbooks 最近发布了 1.0 ( https://developer.xamarin.com/workbooks/),是我在 macOS 上见过的最接近 LINQPad 的版本。

Edit (September 2017):This is still speculative!

编辑(2017 年 9 月):这仍然是推测性的!

Running most Windows applications (including GUI apps) might be possible with Docker and Windows Subsystem for Linux (WSL):

使用 Docker 和适用于 Linux 的 Windows 子系统 (WSL) 可以运行大多数 Windows 应用程序(包括 GUI 应用程序):

Animated demo of cmd.exe running on Ubuntu

在 Ubuntu 上运行的 cmd.exe 动画演示

See the blog post at https://blog.jessfraz.com/post/windows-for-linux-nerds/for a detailed walkthrough.

有关详细演练,请参阅https://blog.jessfraz.com/post/windows-for-linux-nerds/ 上的博客文章。

采纳答案by Joe Albahari

LINQPad doesn't work in Mono primarily because it relies on ActiPro's SyntaxEditor which does some Win32 interop. LINQPad itself also does some interop.

LINQPad 在 Mono 中不起作用,主要是因为它依赖于 ActiPro 的 SyntaxEditor,它执行一些 Win32 互操作。LINQPad 本身也做一些互操作。

An early prototype of LINQPad used a TextBox instead of a syntax editor - this might be what was tested against Mono.

LINQPad 的早期原型使用 TextBox 而不是语法编辑器 - 这可能是针对 Mono 进行测试的。

回答by Justin Niessner

If you look at the Mono documentation, it says that LINQPad is one of the applications they use to test their WinForms implementation:

如果您查看 Mono 文档,它会说 LINQPad 是他们用来测试其 WinForms 实现的应用程序之一:

Winforms Samples - Mono

Winforms 示例 - 单声道

That said, I have to imagine that they've been able to get it to work themselves.

也就是说,我必须想象他们已经能够自己让它发挥作用。

回答by gazp

I also wanted to get LINQpad running under OSX and have found after using the above linked 0.92 version from Joe that it does not seem possible.

我还想让 LINQpad 在 OSX 下运行,并且在使用上面链接的 Joe 的 0.92 版本后发现这似乎不可能。

Although the app starts up under mono and displays the familiar LINQPad screen if you try and run any query it simply crashes and disappears.

尽管该应用程序在单声道下启动并显示熟悉的 LINQPad 屏幕,但如果您尝试运行任何查询,它只会崩溃并消失。

Reason being is that there seems to be some use of a WebBrowser control in that LINQPad version and according to the errors displayed in the terminal window it would appear that libgluezilla is required. From doing some digging about libgluezilla I've seen a few replies from Mono devs that it isn't and won't be available for mac, which is a shame.

原因是该 LINQPad 版本中似乎使用了 WebBrowser 控件,并且根据终端窗口中显示的错误,似乎需要 libgluezilla。通过对 libgluezilla 的一些挖掘,我看到 Mono 开发人员的一些回复说它不适用于 mac,这很遗憾。

Error for reference:

错误供参考:

mono linqpad.exe
libgluezilla not found. To have webbrowser support, you need libgluezilla installed

回答by David Clarke

LinqPad is probably the one thing I miss from moving entirely to Mac for development and I'm not going to run a VM just to access it. As mentioned above, Xamarin Workbooksis actually a pretty decent replacement for macOS.

LinqPad 可能是我完全转移到 Mac 进行开发时所怀念的一件事,我不会为了访问它而运行 VM。如上所述,Xamarin Workbooks实际上是 macOS 相当不错的替代品。

Iterating regex matchesref:https://stackoverflow.com/a/8480659/132599

迭代正则表达式匹配参考:https: //stackoverflow.com/a/8480659/132599