Skip to content

Commit c24fd0d

Browse files
authored
System.Diagnostics.DiagnosticSource example
1 parent 0663c82 commit c24fd0d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

articles/runners/runner-msbuild.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ For example, suppose FluentMigrator.DotNet.Cli ships with a particular version o
2323

2424
As another example, suppose FluentMigrator has not yet shipped a .NET vNext compatible binary, but you want to work with that binary. The `--allowDirtyAssemblies` switch will help resolve the `System.Runtime` assembly.
2525

26+
As another example, suppose you want to use dependency injection to load your data access layer for use with `Execute.WithConnection`. You might get the following runtime error testing your migrations due to MSBuild loading a different version of `System.Diagnostics.DiagnosticSource`:
27+
28+
```
29+
While executing migrations the following error was encountered: Could not load file or assembly 'System.Diagnostics.DiagnosticSource, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.,
30+
at Autofac.Core.Lifetime.LifetimeScope..ctor(IComponentRegistry componentRegistry, Object tag)
31+
at Autofac.Core.Container..ctor(IComponentRegistry componentRegistry)
32+
at Autofac.ContainerBuilder.Build(ContainerBuildOptions options)
33+
```
34+
2635
### `UseMsBuildLogging` (optional, defaults to false)
2736

2837
Historically, the FluentMigrator.MSBuild task uses Console.Out to display output. As MSBuild is multi-threaded, it is unsafe to do it this way.

0 commit comments

Comments
 (0)