如何使用Roslyn作为使用ASP.Net网站的在线编译器? [英] How can I use Roslyn as online compiler using ASP.Net website?

查看:98
本文介绍了如何使用Roslyn作为使用ASP.Net网站的在线编译器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我想使用Roslyn编译器作为使用ASP.Net的在线网页

我已经下载了NuGet打包并使用Roslyn来访问它的API。

但是,我想构建一个允许用户从那里执行任何代码的网页。



我怎么能让它可用?



任何与此相关的建议。





提前完成。

Hi all,

I am wondering to use the Roslyn compiler as online web page using ASP.Net
I have already download NuGet package and use Roslyn from there to access its API's.
However, I want to build a web page that allow users to execute any code from there.

How could I make it available??

Any suggestion related to that.


Thanx in advance.

推荐答案

请看我对这个问题的评论。



我不清楚为什么你真的需要你需要的东西,但我建议考虑一个替代方案:使用主机系统上可用的常规VB.NET和C#编译器。它们之所以可用只是因为您使用的是ASP.NET,而后者又需要在主机上安装.NET(好吧,或者Mono)。在所有情况下,至少这两个编译器始终可用,至少因为.NET应该支持CodeDOM。因此,它们可以通过CodeDOM间接使用。请参阅:

http:// msdn .microsoft.com / zh-CN / library / y2k85ax6%28v = vs.110%29.aspx [ ^ ],

http://msdn.microsoft.com/en-us/library/system.codedom%28v=vs.110%29 .aspx [ ^ ]。



-SA
Please see my comment to the question.

I don't clearly understand why would you really need what you need, but I would suggest to think at one alternative: using "regular" VB.NET and C# compilers available on your host system. They are available simply because you are using ASP.NET, which, in turn, requires installation of .NET on the host computer (well, or Mono). In all cases, at least those two compilers are always available, at least because .NET should support CodeDOM. So, they can be used indirectly, via CodeDOM. Please see:
http://msdn.microsoft.com/en-us/library/y2k85ax6%28v=vs.110%29.aspx[^],
http://msdn.microsoft.com/en-us/library/system.codedom%28v=vs.110%29.aspx[^].

—SA


这篇关于如何使用Roslyn作为使用ASP.Net网站的在线编译器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆