I am on Fody 2.3.15 with Nullguard 1.6.3. The build environment uses MS Build 15.0. The devops build task was working fine in the past but now the build log files show the following error to which I get no clues. Can someone let me know what I am missing out here?
C:\DropBoxBuild\packages\Fody.2.3.15\build\net452\Fody.targets(54,5): error MSB4018: The "Fody.WeavingTask" task failed unexpectedly.
C:\DropBoxBuild\packages\Fody.2.3.15\build\net452\Fody.targets(54,5): error MSB4018: System.TypeInitializationException: The type initializer for 'ContainsTypeChecker' threw an exception.
C:\DropBoxBuild\packages\Fody.2.3.15\build\net452\Fody.targets(54,5): error MSB4018: ---> System.MissingMethodException: Method not found: 'Void System.AppDomainSetup.set_ApplicationBase(System.String)'.
C:\DropBoxBuild\packages\Fody.2.3.15\build\net452\Fody.targets(54,5): error MSB4018: at ContainsTypeChecker..cctor()
C:\DropBoxBuild\packages\Fody.2.3.15\build\net452\Fody.targets(54,5): error MSB4018: --- End of inner exception stack trace ---
C:\DropBoxBuild\packages\Fody.2.3.15\build\net452\Fody.targets(54,5): error MSB4018: at ContainsTypeChecker..ctor()
C:\DropBoxBuild\packages\Fody.2.3.15\build\net452\Fody.targets(54,5): error MSB4018: at Processor..ctor()
C:\DropBoxBuild\packages\Fody.2.3.15\build\net452\Fody.targets(54,5): error MSB4018: at Fody.WeavingTask.Execute()
C:\DropBoxBuild\packages\Fody.2.3.15\build\net452\Fody.targets(54,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
C:\DropBoxBuild\packages\Fody.2.3.15\build\net452\Fody.targets(54,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)
Surprisingly my project solution still builds in VS 2017. So what can go wrong specifically with the build task. This is the command line action which triggers the build.
C:\Program Files\dotnet\dotnet.exe build C:\DropBoxBuild\DropBoxAgent.sln --no-restore
Migrating to the new version of Fody is not an option as it would mean a lot of rework in my devops. I did check the individual projects in the solution and they all use the same version of Fody and weaver.