Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8304111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:44:34+00:00 2026-06-08T17:44:34+00:00

Presently I am attempting to build Gendarme 2.10 using Visual Studio 2010. Here are

  • 0

Presently I am attempting to build Gendarme 2.10 using Visual Studio 2010. Here are some of the errors I’m receiving:

Error   85  Argument 1: cannot convert from 'System.Reflection.ConstructorInfo' to 'Mono.Cecil.TypeReference'   C:\Tools\mono-tools\external\cecil\Test\Mono.Cecil.Tests\CustomAttributesTests.cs   359 45  Mono.Cecil.Tests
Error   12  Argument 1: cannot convert from 'System.Reflection.FieldInfo' to 'Mono.Cecil.TypeReference' C:\Tools\mono-tools\external\cecil\Test\Mono.Cecil.Tests\ImportReflectionTests.cs   103 45  Mono.Cecil.Tests
Error   24  Argument 1: cannot convert from 'System.Reflection.FieldInfo' to 'Mono.Cecil.TypeReference' C:\Tools\mono-tools\external\cecil\Test\Mono.Cecil.Tests\ImportReflectionTests.cs   149 44  Mono.Cecil.Tests
Error   46  Argument 1: cannot convert from 'System.Reflection.FieldInfo' to 'Mono.Cecil.TypeReference' C:\Tools\mono-tools\external\cecil\Test\Mono.Cecil.Tests\ImportReflectionTests.cs   198 44  Mono.Cecil.Tests
Error   60  Argument 1: cannot convert from 'System.Reflection.FieldInfo' to 'Mono.Cecil.TypeReference' C:\Tools\mono-tools\external\cecil\Test\Mono.Cecil.Tests\ImportReflectionTests.cs   276 39      Mono.Cecil.Tests
Error   14  Argument 1: cannot convert from 'System.Reflection.MethodInfo' to 'Mono.Cecil.TypeReference'    C:\Tools\mono-tools\external\cecil\Test\Mono.Cecil.Tests\ImportReflectionTests.cs   117 43  Mono.Cecil.Tests

After I remove all the tests projects, here are the errors I’m getting:

Error   4   Argument 1: cannot convert from 'System.Type' to 'Mono.Cecil.TypeReference' C:\Tools\mono-tools\gendarme\framework\Gendarme.Framework.Helpers\PrimitiveReferences.cs    53  25  Gendarme.Framework
Error   3   The best overloaded method match for 'Mono.Cecil.ModuleDefinition.Import(Mono.Cecil.TypeReference)' has some invalid arguments  C:\Tools\mono-tools\gendarme\framework\Gendarme.Framework.Helpers\PrimitiveReferences.cs    53  10  Gendarme.Framework

Here is the code that the above two errors refer to:

static TypeReference GetReference (Type type, IMetadataTokenProvider metadata)
{
    ModuleDefinition module = metadata.GetAssembly ().MainModule;
    TypeReference tr;
    if (!module.TryGetTypeReference (type.FullName, out tr))
        tr = module.Import (type);
    return tr;
}

Does anyone have any suggestions? TIA.

Roger

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T17:44:37+00:00Added an answer on June 8, 2026 at 5:44 pm

    Here is a temporary solution I put together. Please feel free to comment:

        static TypeReference GetReference (Type type, IMetadataTokenProvider metadata)
        {
            ModuleDefinition module = metadata.GetAssembly ().MainModule;
            ModuleKind kind = ModuleKind.Windows;
            ModuleDefinition definition = ModuleDefinition.CreateModule(module.Name, kind);
            Version version = new Version(1, 0);
            AssemblyNameDefinition nameDefinition = new AssemblyNameDefinition(module.Name, version);
            AssemblyDefinition assemblyDefinition = AssemblyDefinition.CreateAssembly(nameDefinition, definition.Name, kind);
            assemblyDefinition = AssemblyDefinition.ReadAssembly(module.Name);
            definition.Assembly = assemblyDefinition;
            IMetadataScope scope = new ModuleReference(module.Name);
            scope.MetadataToken = assemblyDefinition.MetadataToken;
    
            TypeReference tr = new TypeReference(type.Namespace, type.Name, definition, scope);
            //if (!module.TryGetTypeReference(type.FullName, out tr))
            //    tr = module.Import(type);
            return tr;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Presently I am attempting to create unit tests using MSTest.exe for multithreading functionality. When
Presently I am attempting to build a tool that will open a Microsoft Word
As per http://msdn.microsoft.com/en-us/library/h21twfw7(v=VS.100).aspx (for Visual Studio 2010) strstreambuf is deprecated. I was of the
I am attempting to build the Android port of Hedgewars on Windows, using make/ant
I am presently developing a web service using Ruby on Rails. I wish to
I am attempting to run my rails app using Passenger and Apache. As far
I am attempting to write some jQuery code that will expand a paragraph when
I am having some issues with nested models in a form, using Rails 3.1rc4.
I'm presently attempting to write a few classes to aid me in writing various
Here is where I am at presently. I am designing a card game with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.