In ASP.NET with the normal ASP model you could have the codefile of the aspx file in a dll by inheriting the class inside the dll. In IronPython you have another model and the only option in the aspx page is "codefile" and there is no "inherits". My question is, is there any way to associate an aspx file to a source file which is not directly viewable such as a dll or a pyc file?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
It cannot be currently done with just IronPython. The .dll file created by pyc.py
cannot be used. When you check it with Reflector - you don't find the necessary .NET classes.
The option I use is to create a stub in C# that creates IronPython engine and run the script file inside it. See this article for how to embedd IronPython into C#.