c# - Cheap way to wrap .exe for Custom Tool? -


i have custom script language , compiler (an exe written in c) turns language in c# code. i'd hook script compiler custom tool on script files in solution, , have generate c# code behind.

i've seen articles , tutorials online, , have generate com interfaces , register custom dll registry , gac, , don't want deal that.

is there wrapper or hack or 3rd party plugin somewhere make easier? if there way run batch script custom tool, , have code behind file generated stdout of that, pipe file compiler stdout.

first off, know said don't want register through msft way, suggest reconsider. details here: http://msdn.microsoft.com/en-us/library/vstudio/bb166527.aspx

now got out of way, suggestion you:

  1. put exe in fixed location (best spot right in root of solution or repository). next, run tool manually once, way have .cs files or whatever generating can add them solution. way c# compiler knows there , have hit build button , it'll have files build.

  2. next, create pre-build event (under project properties, build events tab) calls exe appropriate command line arguments make thing (generate new cs files). suggest edit exe take multiple files @ time, make pre-build command more simple. (this placing file in sln or repo directory helpful, because can use vs macros absolute path both exe , files read in.)

  3. what happens now, before msbuild gets called (but after hit build) script (or exe) run generate new output files. since msbuild hasn't started yet can change solution files hearts content , changes picked both msbuild , (probably once build complete) vs.

notes: have never been able build event work on first try, throws error show in vs error/warnings window. copy whole error notepad (or scite) , edit down actual command line arguments. open command shell , try execute it. errors here more helpful , can tweak until right , copy changes in vs.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -