microsoft / MSBuildLocator

An API to locate MSBuild assemblies from an installed Visual Studio location. Use this to ensure that calling the MSBuild API will use the same toolset that a build from Visual Studio or msbuild.exe would.
Other
220 stars 83 forks source link

Add explanation for Builder class in example #15

Closed nopppers closed 6 years ago

nopppers commented 6 years ago

When implementing MSBuildLocator I originally called MSBuildLocator.RegisterInstance(), then later in the same function I called other Microsoft.Build functions.

This is my first large project with a major C# component. I didn't know that all of the dll imports in my function would be loaded when the function was entered, instead of when the import procedures were called.

This request adds a short description above the Builder class to explain why it's necessary--so that the MSBuildLocator dll loads first, then after the appropriate setup is requested and the Builder class is instantiated can more Microsoft.Build dlls be loaded properly.

nopppers commented 6 years ago

Alright, comment changes implemented.

The error in #14 helped a lot, yeah. It was what spurred me to come look at the example :smile: