VS2010:创建构建后事件 (C#)
我想优雅地将构建后事件添加到项目中。我先批量编写它们,但它们有一点逻辑,所以我认为最好用更易读的语言编写它们。该项目是免费开源的,因此我希望它可以在 Visual C# Express 2010 和 SharpDevelop 以及 VS2010 中构建,并避免使用第三方软件。
我发现 MSBuild 内联任务,它可能会起作用这个目的。我认为如果构建任务是项目中的文件(而不是项目文件中),对其他开发人员来说会更直观,并且显然有一种方法可以做到这一点,但我还没有找到任何好的资源。
我们可以在此处获取易于参考的构建后模板和/或其他构建后资源吗?
I want to add post-build events to a project, elegantly. I wrote them in batch first, but there's a little logic in them, so I thought it might be best to write them in a more readable language. The project is free open-source, so I want it to build in Visual C# Express 2010 and SharpDevelop as well as VS2010, and avoid third-party software.
I found MSBuild Inline Tasks, which might serve this purpose. I figure it would be more intuitive to other developers if the build tasks were a file in the project (instead of in the project file), and apparently there is a way to do this, but I haven't found any good resources on it.
Can we get an easy-reference Post-Build template here, and/or other post-build resources?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我继续以批处理形式保留后期构建事件,但我将代码移至批处理文件中,以便我可以使用带有语法突出显示的更好的文本编辑器。
您还可以通过这种方式使用 CS-Script 等脚本语言,我稍后可能会这样做。它确实需要第 3 方软件,但您可以使用 C# 编写具有完整语法突出显示和代码完成功能的构建事件。
I went ahead and left the post build event in batch form, but I moved the code into a batch file so I could use a better text-editor with syntax highlighting.
You can also use a scripting language like CS-Script this way, which I'll probably do later. It does require 3rd party software, but you can write the build event in C# with full syntax highlighting and code completion features.