Hello Tuomas,
The issue is inside Cecil. The root problem is that Gendarme, like
most Cecil tools, can work on assemblies compiled with another version
of the framework/runtime (e.g. Mono, Silverlight...) and, while a nice
feature, it needs some hacks to find where the FX assemblies (for the
analyzed assemblies) are located.
I'll talk to JB to get Gendarme 2.6 (i.e. the Cecil version in Mono
2.6) to work with VS2010 beta1. However this is likely to break in the
future since the location of the assemblies is, generally, associated
with their version number and this part is likely to change for beta2
(and/or the final release of .NET 4.0).
The long term (post 2.6) solution is to add events inside Cecil when
the Resolver fails to find an assembly and let the application
(Gendarme in this case) deal with the situation. Which will likely
mean a way (e.g. command line open or a window dialog) for the end-
users to provide the location.
Sebastien
On Oct 6, 10:59 am, Thorium <tuomas.hieta...@iki.fi> wrote:
> I tried to use Gendarme with .NET 4.0 dll and got:
> Stack trace: System.NotSupportedException: Version not supported:
> 4.0.0.0
> at Mono.Cecil.BaseAssemblyResolver.GetCorlib(AssemblyNameReference
> reference)
> at Mono.Cecil.BaseAssemblyResolver.Resolve(AssemblyNameReference
> name)
> at Gendarme.Framework.AssemblyResolver.Resolve
> (AssemblyNameReference name)
> at Gendarme.Framework.AssemblyResolver.Resolve(TypeReference type)
> at Gendarme.Framework.Rocks.TypeRocks.Resolve(TypeReference self)
> at Gendarme.Framework.Rocks.TypeRocks.Inherits(TypeReference self,
> String className)
> at Gendarme.Framework.Rocks.TypeRocks.IsAttribute(TypeReference
> self)
> at
> Gendarme.Rules.Design.AttributeArgumentsShouldHaveAccessorsRule.CheckType
> (TypeDefinition type)
> at Gendarme.Framework.Runner.OnType(RunnerEventArgs e)
> at Gendarme.Framework.Runner.Run()
> at Gendarme.ConsoleRunner.Run()
> at Gendarme.ConsoleRunner.Execute(String[] args)
> --
> - Tuomas