<commit_before>A utility to perform design-time builds of .NET projects without having to think too hard about it.

<img src="https://buildalyzer.netlify.com/assets/img/buildalyzer.png" style="width: 50%" alt="Logo">

**NuGet**
* [Buildalyzer](https://www.nuget.org/packages/Buildalyzer/)
* [Buildalyzer.Workspaces](https://www.nuget.org/packages/Buildalyzer.Workspaces/)

**MyGet**
* [Buildalyzer](https://www.myget.org/feed/buildalyzer/package/nuget/Buildalyzer)
* [Buildalyzer.Workspaces](https://www.myget.org/feed/buildalyzer/package/nuget/Buildalyzer.Workspaces)

**GitHub**
* [Buildalyzer](https://github.com/daveaglick/Buildalyzer)

**Donations**

<a href="https://www.buymeacoffee.com/daveaglick"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: auto !important;width: auto !important;" ></a>

---

## What Is It?

Buildalyzer lets you run MSBuild from your own code and returns information about the project. By default, it runs a [design-time build](https://daveaglick.com/posts/running-a-design-time-build-with-msbuild-apis) which is higher performance than a normal build because it doesn't actually try to compile the project. You can use it to perform analysis of MSBuild projects, get project properties, or create a Roslyn Workspace using [Buildalyzer.Workspaces](https://www.nuget.org/packages/Buildalyzer.Workspaces/). It runs MSBuild out-of-process and therefore should work anywhere, anytime, and on any platform you can build the project yourself manually on the command line.


```csharp
AnalyzerManager manager = new AnalyzerManager();
ProjectAnalyzer analyzer = manager.GetProject(@"C:\MyCode\MyProject.csproj");
AnalyzerResults results = analyzer.Build();
string[] sourceFiles = results.First().SourceFiles;
```

## Installation

Buildalyzer is [available on NuGet](https://www.nuget.org/packages/Buildalyzer/) and can be installed via the commands below:

```
$ Install-Package Buildalyzer
```
or via the .NET Core CLI:

```
$ dotnet add package Buildalyzer
```

Buildalyzer.Workspaces is [available on NuGet](https://www.nuget.org/packages/Buildalyzer.Workspaces/) and can be installed via the commands below:<commit_msg>Added blog posts to readme (#50)<commit_after>A utility to perform design-time builds of .NET projects without having to think too hard about it.

<img src="https://buildalyzer.netlify.com/assets/img/buildalyzer.png" style="width: 50%" alt="Logo">

**NuGet**
* [Buildalyzer](https://www.nuget.org/packages/Buildalyzer/)
* [Buildalyzer.Workspaces](https://www.nuget.org/packages/Buildalyzer.Workspaces/)

**MyGet**
* [Buildalyzer](https://www.myget.org/feed/buildalyzer/package/nuget/Buildalyzer)
* [Buildalyzer.Workspaces](https://www.myget.org/feed/buildalyzer/package/nuget/Buildalyzer.Workspaces)

**GitHub**
* [Buildalyzer](https://github.com/daveaglick/Buildalyzer)

**Donations**

<a href="https://www.buymeacoffee.com/daveaglick"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: auto !important;width: auto !important;" ></a>

---

## What Is It?

Buildalyzer lets you run MSBuild from your own code and returns information about the project. By default, it runs a [design-time build](https://daveaglick.com/posts/running-a-design-time-build-with-msbuild-apis) which is higher performance than a normal build because it doesn't actually try to compile the project. You can use it to perform analysis of MSBuild projects, get project properties, or create a Roslyn Workspace using [Buildalyzer.Workspaces](https://www.nuget.org/packages/Buildalyzer.Workspaces/). It runs MSBuild out-of-process and therefore should work anywhere, anytime, and on any platform you can build the project yourself manually on the command line.


```csharp
AnalyzerManager manager = new AnalyzerManager();
ProjectAnalyzer analyzer = manager.GetProject(@"C:\MyCode\MyProject.csproj");
AnalyzerResults results = analyzer.Build();
string[] sourceFiles = results.First().SourceFiles;
```

These blog posts might also help explain the motivation behind the project and how it works:
* [Running A Design-Time Build With MSBuild APIs](https://daveaglick.com/posts/running-a-design-time-build-with-msbuild-apis)
* [MSBuild Loggers And Logging Events](https://daveaglick.com/posts/msbuild-loggers-and-logging-events)


## Installation

Buildalyzer is [available on NuGet](https://www.nuget.org/packages/Buildalyzer/) and can be installed via the commands below:

```
$ Install-Package Buildalyzer
```
or via the .NET Core CLI:

```
$ dotnet add package Buildalyzer
```

Buildalyzer.Workspaces is [available on NuGet](https://www.nuget.org/packages/Buildalyzer.Workspaces/) and can be installed via the commands below:
{'fraction_non_alphanumeric': 0.12850565089995813, 'fraction_numerical': 0.0012557555462536626, 'mean_word_length': 5.440700808625337, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 26, 'lorem ipsum': 0, 'www.': 18, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '580486', 'n_tokens_mistral': 1499, 'n_tokens_neox': 1429, 'n_words': 400}