linux上的。net内核:如何加载外部项目?

时间:2023-01-13 15:50:25

First of all, I don't know much about Roslyn. I went through a few tutorials hot to generate code and how to parse a string containing code. So far, everything is clear to me.

首先,我对罗斯林不太了解。我浏览了一些关于生成代码的教程,以及如何解析包含代码的字符串。到目前为止,我对一切都很清楚。

Here is my question: I'm using dotnet core 1.0.1 on Linux. I created a new project with some interfaces defining some properties. What I want to do is to create a program in which I can load the project, run trough the interfaces (*.cs files) and generate some code. My problem is, I don't know how to load/open a c# project with Roslyn.

我的问题是:我在Linux上使用的是dotnet core 1.0.1。我创建了一个新项目,其中一些接口定义了一些属性。我要做的是创建一个程序,在这个程序中我可以加载项目,通过接口运行(*)。并生成一些代码。我的问题是,我不知道如何加载/打开一个c#项目与Roslyn。

The tutorials I found are using a windows environment. These samples doesn't work on my environment because there are some dependencies to MSBuild or Visual Studio. I read and tried some things about the AdhocWorkspace, but I didn't manage to open an existing solution this way.

我发现的教程使用的是windows环境。这些示例不能在我的环境中工作,因为MSBuild或Visual Studio有一些依赖项。我阅读并尝试了关于AdhocWorkspace的一些东西,但是我没有设法以这种方式打开一个现有的解决方案。

Can anyone give me a hint how to start? Is it possible to open/load a project (*.csproj) and run through all *.cs-files?

谁能给我点建议吗?是否可以打开/加载一个项目(*.csproj)并运行所有*.cs文件?

Thanks in advance.

提前谢谢。

1 个解决方案

#1


2  

Currently, there is no good way to open .Net projects using Roslyn on .Net Core.

目前,在。net Core中没有使用Roslyn打开。net项目的好方法。

See this issue on the Roslyn repo, where the recommended solution is to use code from the Omnisharp project.

在Roslyn repo上看到这个问题,推荐的解决方案是使用Omnisharp项目的代码。

#1


2  

Currently, there is no good way to open .Net projects using Roslyn on .Net Core.

目前,在。net Core中没有使用Roslyn打开。net项目的好方法。

See this issue on the Roslyn repo, where the recommended solution is to use code from the Omnisharp project.

在Roslyn repo上看到这个问题,推荐的解决方案是使用Omnisharp项目的代码。