Can Microsoft.Build.BuildEngine be multithreaded

I have a number of Visual Studio build solutions.

Can Microsoft.Build.BuildEngine be used to create multiple solutions at the same time (i.e. by multithreading)?

I know that he has some kind of STAThread requirement, although I never understood what this means for my programs.

Edit: Let me clarify. I know that MSBuild can do multi-threaded builds of projects in a solution. I have a question: can Microsoft.Build.BuildEngine.Engine use different threads to create different solutions / projects.

I tried to create separate Engines in different threads, and that didn't work. When I tried to use one engine, it worked in one thread.

Can Microsoft.Build.BuildEngine .NET library collect more than one project / solution at a time?

+4
source share
1 answer

It depends on what you do. Yes, you can execute several parallel projects (in VS go to Tools β†’ Options β†’ Projects and solutions β†’ Build and run). If you are using MSBuild, you can use the / m [: number] command. Regarding BuildEngine, which is deprecated in favor of Microsoft.Build.Construction/Microsoft.Build.Evaluation/Microsoft.Build.Execution, which I believe BuildParameters.MaxNodeCount determines the number of threads. Although I personally would recommend just running msbuild on your own or using an IDE, it's a lot easier.

0
source

All Articles