.net port of preprocess