Domanda

I am running code inspections for a C# project on TeamCity 8.0.6. The inspections are presently returning over two hundred compiler errors, all of which are related to AutoMapper mapping configuration definitions.

Anywhere a mapping configuration is defined, the code inspections return a C# compiler error and a message similar to this:

Cannot resolve method 'ForMember(lambda expression, lambda expression)', candidates are...

ReSharper and AutoMapper are playing nicely in my local environment -- code inspections run without error. It is only on the build server with TeamCity's embedded code inspection plugin that these errors appear.

Compatibility issues between AutoMapper and ReSharper code inspections have been documented before, and there are workarounds people use for VisualStudio-based inspections. The difference here is that the inspections are running with TeamCity's embedded version of ReSharper, rather than the VisualStudio plugin. Consequently, many of the fixes, such as closing and reopening VisualStudio or disabling and reenabling the ReSharper plugin don't apply.

Has anyone encountered similar issues with TeamCity's embedded .NET code inspection plugin, and, if so, how were you able to resolve it?

For the record, the plugin name is dotnet-tools, and the version is 27767, and they are running under TeamCity 8.0.6 (the current version as of this writing). I can confirm that there is only one version of the AutoMapper DLL being used in the solution.

È stato utile?

Soluzione

The only fix for this is to upgrade. This specific error hasn't appeared after we upgraded TeamCity to 8.1.5.. This changes the plugin versions to 30240, and it can handle the AutoMapper configuration without generating compiler errors.

There are still substantial differences in the results between the inspections executed by the build server and inspections run in Visual Studio, but I am no longer seeing hundreds of compiler errors generated by AutoMapper configuration.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top