使用 monodevelop 打开 .csproj

发布于 2025-01-04 12:59:55 字数 428 浏览 3 评论 0原文

我已经下载了一个包含 .csproj 项目格式示例的框架。 如何在 MonoDevelop 中打开它们?

我有兴趣使用该框架中的一些类。 它的文件夹结构如下: Accord.Statistics.Models 和一个主文件夹 Accord 以及一个子文件夹 stats 和一个子文件夹 Models 以及一个文件 ModelFoo.cs

使用该文件(以 开头

namespace Accord.Statistics.Models

我想在 Ubuntu 下的 MonoDevelop 解决方案中

)。如果我在新解决方案中复制文件夹或单个文件,则会收到错误

您是否缺少 using 指令或程序集引用?

我该怎么办?

I've downloaded a framework with samples in .csproj project format.
How can I open them in MonoDevelop?

I'm interested in using some classes in that framework.
It has a folder structure like: Accord.Statistics.Models and a main folder Accord with a subfolder Statistics with a subfolder Models with a file ModelFoo.cs

I want to use that file (that begin with

namespace Accord.Statistics.Models

) in a MonoDevelop Solution under Ubuntu.

If I copy the folder or single files inside my new Solution I get the error

Are you missing a using directive or an assembly reference?

How can I do?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

七婞 2025-01-11 12:59:55

创建一个新的空解决方案,将项目及其源复制到解决方案文件夹中,然后右键单击解决方案资源管理器中的解决方案
(“视图”→“Pad”→“解决方案”)并选择“添加”→“添加现有项目”。

Create a new empty solution, copy your projects and their sources into the solution folder, then right click on the solution in the solution explorer
("View" → "Pads" → "Solution") and choose "Add" → "Add Existing Project".

向日葵 2025-01-11 12:59:55

您最好不要打开 VS 项目文件,而是创建一个 MonoDevelop 项目文件并将必要的代码文件和引用(通常是 Accord.dll、Accord.Statistics.dll 或类似的内容)添加到新项目中。当然,前提是 MonoDevelop 没有导入功能。

通常,当您使用当前项目外部定义的符号时,会出现“缺少使用或引用”错误。如果您实际上正在使用另一个程序集中的某些内容,则需要将其添加为对项目的引用,以便导入元数据并用于链接。如果来自同一个项目,您可能需要使用 using Accord.Statistics.Models 语句导入命名空间。

Rather than opening the VS project file, you may be better off making a MonoDevelop project file and adding the code files and references necessary (typically Accord.dll, Accord.Statistics.dll, or something along those lines) to your new project. That is, of course, if MonoDevelop doesn't have an import function.

Generally, the "missing using or reference" error comes when you use a symbol defined outside of the current project. If you're actually using something from another assembly, you need to add it as a reference to the project, so the metadata is imported and used to link. If it's from the same project, you may need to import the namespace with a using Accord.Statistics.Models statement.

颜漓半夏 2025-01-11 12:59:55

首先,我会为 MonoDevelop 使用单独的解决方案文件,因为 MD 有时会在其中放置略有不同的设置。这同样适用于 .csproj 文件,因此如果您希望您的项目可以同时使用 VS 和 MD 进行编译,请注意不要提交任何在 VS 中不起作用的项目文件更改。

关于您的问题:使用 MD 删除引用并重新添加它们。 MD 以与 VS/MD 兼容的方式添加引用(我的经验)。

First of all, I would use a separate solution file for MonoDevelop because MD sometimes puts slightly different settings in there. The same applies to .csproj files, so if you want your project compilable with both VS and MD, watch out that you don't commit any project file changes that don't work in VS.

Regarding your problem: Remove the references using MD and re-add them. MD adds references in a way that they're compatible with both VS/MD (my experience).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文