是否有从 Visual Studio 项目中编译 CIL 代码的示例
我意识到有人询问并回答了 Visual Studio 不支持 CIL/MSIL 项目。 MSBuildContrib 项目有一个 ILASM 任务,允许您在构建时编译 IL 文件。
谷歌搜索没有找到如何使用此任务的示例。
是否有使用 ILASM 作为 Visual Studio 解决方案一部分的示例? 我意识到 #develope 和 ILIDE 支持 CIL...这里的目标是编译一些 CIL 文件作为 Visual Studio 解决方案的一部分。
I realize that it's been asked and answered that Visual Studio does not support CIL/MSIL projects. The MSBuildContrib project has an ILASM task which allows you to compile IL files at build time.
Googled came up empty on examples for how to use this task.
Are there any examples of using ILASM as part of a Visual Studio solution?
I realize that #develope and ILIDE support CIL... the objective here is to compile some CIL files as part of a Visual Studio solution.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我对 Hans 回答这个问题给予了赞扬,但经过一些实验,我得到了一个稍微接近我的解决方案:
如何在 VISUAL STUDIO 中编译 CIL/MSIL
以下 hack 为您提供了一个项目,该项目:
请按照下列步骤操作:
以下是 XML:
I gave Hans credit for answering this question, but after some experimentation I've got a solution which comes slightly closer to home:
HOW TO COMPILE CIL/MSIL INSIDE VISUAL STUDIO
The following hack gets you a project which:
Follow these steps:
Here's the XML:
您可以添加一个“makefile 项目”。该模板位于 Visual C++、常规下。此项目类型允许您为“构建”、“清理”和“重建”操作指定自定义构建命令。环境将自动设置,因此您不必弄乱路径。 C++ IDE 还支持创建自定义构建规则,以便您可以从文件扩展名 (.il) 自动触发正确的工具 (ilasm.exe)。
然而,这已经是最好的了。项目中的多个 .il 文件不会自动映射到单个构建命令。需要编写 nmake.exe makefile 才能获得该文件。并注意自定义构建规则支持在 vs2010 中被破坏。
You could add a "makefile project". The template is under Visual C++, General. This project type allows you to specify custom build commands for the Build, Clean and Rebuild actions. The environment will be setup automatically so you don't have to mess with paths. The C++ IDE also supports creating a custom build rule so you can automatically trigger the right tool (ilasm.exe) from the file name extension (.il).
That's however about as good as it gets. There is no automatic mapping of multiple .il files in the project to a single build command. Writing an nmake.exe makefile is required to get that. And beware that custom build rules support got broken in vs2010.