简体   繁体   中英

VS2010: Creating Post-Build Events (C#)

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM