How can I get output file names after a C# MSBuild completes? -


i using buildmanager.defaultbuildmanager.build() build visual studio solution contains many projects. code looks lot this.

once build completes, i'd copy output (dlls in case) target folder.

but don't see way retrieve file names of build output buildresult.

i can scan sln file , infer output locations. error-prone , tedious.

build() returns buildresult. far can tell, buildresult not contain actual output file names.

how can output file names after build completes?

you provide output path build. clear folder before build , work newly generated files.

var solutionpath = "..."; var outputpath = "...";  var pc = new projectcollection(); var properties = new dictionary<string, string>(); properties.add("outputpath", outputpath);  var request = new buildrequestdata(solutionpath, properties, null, new string[] { "build" }, null); var result = buildmanager.defaultbuildmanager.build(new buildparameters(pc), request);  // stuffs dlls var libraries = directory.getfiles(outputpath, "*.dll"); 

Comments

Popular posts from this blog

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -