问题
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?
回答1:
Create a new empty solution and then copy your projects and thier sources into the solution folder, then right click on the solution in the solution explorer and choose "Add > Add Existing Project"
回答2:
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.
回答3:
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).
来源:https://stackoverflow.com/questions/9220290/open-a-csproj-with-monodevelop