The problem is causes by the CODE_ANALYSIS being on, maybe in combinations with "treat warnings as errors"
The "no custom build steps" is maybe not that true, i remembered that when getting the repo i had to run a powershell script. And, behold, it does inject dlls into the \bin catalog in the project. I only checked to see if the project itself had any problems.
The code analysis log looks like this:
<Exception Keyword="CA0001" Kind="Engine">
<Type>Microsoft.FxCop.Sdk.InvalidMetadataException</Type>
<ExceptionMessage>Unknown constant type.</ExceptionMessage>
<StackTrace> at Microsoft.FxCop.Sdk.MetadataReader.GetValueFromBlob(Int32 type, Int32 blobIndex)
at Microsoft.FxCop.Sdk.Reader.GetLiteral(Int32 parentCodedIndex, TypeNode type)
at Microsoft.FxCop.Sdk.Reader.AddMoreStuffToParameters(Method method, ParameterCollection parameters, Int32 start, Int32 end)
at Microsoft.FxCop.Sdk.Reader.GetMethodFromDef(Int32 index, TypeNode declaringType)
at Microsoft.FxCop.Sdk.Reader.AddMethodsToType(TypeNode type, MethodPtrRow[] methodPtrs, Int32 start, Int32 end)
at Microsoft.FxCop.Sdk.Reader.GetTypeMembers(TypeNode type, Object handle)
at Microsoft.FxCop.Sdk.TypeNode.get_Members()
at Microsoft.FxCop.Sdk.Duplicator.ProvideTypeMembers(TypeNode dup, Object handle)
at Microsoft.FxCop.Sdk.Specializer.ProvideTypeMembers(TypeNode typeNode, Object handle)
at Microsoft.FxCop.Sdk.TypeNode.get_Members()
at Microsoft.FxCop.Sdk.TypeNode.GetMembersNamed(Identifier name)
at Microsoft.FxCop.Sdk.Reader.GetMemberFromRef(Int32 i, TypeNodeCollection& varArgTypes, Int32 numGenericArgs)
at Microsoft.FxCop.Sdk.Reader.GetMemberFromToken(Int32 tok, TypeNodeCollection& varArgTypes)
at Microsoft.FxCop.Sdk.InstructionParser.ParseInstruction()
at Microsoft.FxCop.Sdk.InstructionParser.ParseInstructions()
at Microsoft.FxCop.Sdk.Reader.ParseMethodInstructions(Method method, Int32 methodIndex, Int32 RVA)
at Microsoft.FxCop.Sdk.Reader.GetMethodInstructions(Method method, Object i)
at Microsoft.FxCop.Sdk.Reader.GetMethodBody(Method method, Object i, Boolean asInstructionList)
at Microsoft.FxCop.Sdk.Method.get_Instructions()
at Microsoft.FxCop.Sdk.RuleUtilities.HasImperativeSecurityAction(Method method, SecurityAction action)
at Microsoft.FxCop.Sdk.RuleUtilities.HasSecurityAction(Method method, SecurityAction action)
at Microsoft.FxCop.Sdk.RuleUtilities.HasSecurityAction(Method method, SecurityAction[] actions)
at Microsoft.FxCop.Engines.Introspection.LoadVisitor.RecordCallSites(Method caller)
at Microsoft.FxCop.Engines.Introspection.LoadVisitor.VisitMember(Member member, TargetMember target)
at Microsoft.FxCop.Engines.Introspection.BaseVisitor.VisitMembers(MemberCollection members, TargetMemberDictionary targets, Boolean visitNestedTypes)
at Microsoft.FxCop.Engines.Introspection.BaseVisitor.VisitType(TypeNode type, TargetType target)
at Microsoft.FxCop.Engines.Introspection.LoadVisitor.VisitType(TypeNode type, TargetType target)
at Microsoft.FxCop.Engines.Introspection.BaseVisitor.VisitTypes(TypeNodeCollection types, TargetNamespaceDictionary targets)
at Microsoft.FxCop.Engines.Introspection.LoadVisitor.VisitModule(ModuleNode module, TargetModule target)
at Microsoft.FxCop.Engines.Introspection.BaseVisitor.VisitAssembly(AssemblyNode assembly, TargetFile target)
at Microsoft.FxCop.Engines.Introspection.LoadVisitor.VisitAssembly(AssemblyNode assembly, TargetFile target)
at Microsoft.FxCop.Engines.Introspection.LoadVisitor.Load(TargetFile target, Boolean buildTree, Boolean queueItems, AssemblyNode loadedAssembly)
at Microsoft.FxCop.Engines.Introspection.LoadVisitor.LoadAssemblies(Queue queue, ExceptionCollection exceptions)</StackTrace>
</Exception>
I have tried to add the dlls to the build with a post-build-step, but it dosen't seem to help.
I have traced the bug in the VCS also, and it is introduced in changeset that adds a call to one of the services defined in one of the injected dlls. I'm pretty sure that this is the problem.
Next step is to figure out how to either correct my build or reproduce this ugly solution in the build for nchrunch....