FxCop 1.36 with VS2005 -Could not resolve member reference

Kilitli FxCop 1.36 with VS2005 -Could not resolve member reference

  • 18 Ocak 2010 Pazartesi 15:51
     
     
    CA0001 : The following error was encountered while reading module 'XXXXX.XXXXXXX.XXXXXX': Could not resolve member reference: XXXXX.XXX.XXXX.Status::get_StatusFlag

    Thanks n Regards

    Venkat Duvvuri

Tüm Yanıtlar

  • 19 Ocak 2010 Salı 01:26
    Moderatör
     
     

    Hello,

    Thanks for your post!

    Would you please provide us more information? Does this error happen on our assembly or the Code Analysis Engine? Would you please open the CodeAnalysisReport.xml in the \obj folder and paste the information here?

    To find out the source code/source line where the error occurs, we could also debug our custom rules (if we are writing a custom rule). Please follow the steps in one of the FAQs in our blog and have a try!

    Thanks a lot!


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!
  • 19 Ocak 2010 Salı 04:23
     
     
    Hi Rohan,

    I am using FxCop1.36 with VS2005 during PostBuild event. I am passing Post-build event command like the one which I have displayed below..

    copy /y "$(TargetPath)" "C:\eComObjects"
    cd "$(ProjectDir)..\..\..\Scripts\FxCopScripts\"
    "runfxcop.cmd" "$(TargetPath)"

    If I Build my project without using fxcop command Build got succeeded. I am using the same command for all my projects. Here I am not going to generate any CodeAnalysisReport.xml file. Only for the single project I got the above specified error.

    Thanks n Regards

    Venkat Duvvuri

  • 19 Ocak 2010 Salı 06:45
    Moderatör
     
     

    Hello,

    Would you please specify what do you expect? If you want to launch fxcop after building, you may try this:
    "C:\Program Files\Microsoft FxCop 1.36\fxcop.exe" $(TargetPath)
    in the Post-build event box (please modify the directory where you install FxCop)

    Best regards


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!
  • 19 Ocak 2010 Salı 09:48
     
     
    The Specified command "D:\UnicornLocal\Scripts\FxCopScripts\fxcop.exe" $(TargetPath) is not working properly. It is going to open FxCop GUI...Followed by VS got busy state..
  • 20 Ocak 2010 Çarşamba 12:10
    Moderatör
     
     

    Would you please tell us your expectation then?


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!
  • 05 Ekim 2010 Salı 06:34
    Moderatör
     
     

    Hello,

    Would you please provide us detail steps to reproduce the issue? I tested it with FxCop 1.36 and VS2008, unfortunately, I did not reproduce it. I'll try my best to help you out.

    Thanks a lot!


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!
  • 22 Aralık 2010 Çarşamba 10:22
     
     

    Hi,

    I have the same problem. I noticed the problem, after we started to introduce new generic interfaces and classes. Is it possible fxcop has a bug handling generics?

    We have currently 10 projects in our solution - 6 of them can't be analyzed.

  • 22 Aralık 2010 Çarşamba 13:14
     
      Kod İçerir

    hi,

    maybe this code snippet is helpful. I have an interface which is placed in a global project:

    public interface IManager<T>
      where T : DataModel
    {
      ...
      void UpdateModel<TUpdatable>(TUpdatable model)
        where TUpdatable : T, IUpdatable;
      ...
    }
    

    Please notice I am using TWO constraints - one for the class and one for the method. Another project (business.dll) is implementing the business logic and refers to this interface / assembly.

    Now fxcop gives me the following error:

    The following error was encountered while reading module "business.dll": Could not resolve member reference [...IManager`1<type parameter.T>::UpdateMo... (nothing more)

    I am not sure, but I think I got the errors since I am using constrains.

  • 22 Aralık 2010 Çarşamba 16:44
     
      Kod İçerir

    I got it. It seems FxCop has a problem with explict implemented interfaces.

    The following code works fine:

    public void Update<TUpdatable>(TUpdatable updatable) where TUpdatable : Customer, IUpdatable
    {
      throw new NotImplementedException();
    }
    
    

    The following code not:

    public class CustomerManager : IManager<Customer>
    {
      void IManager<Customer>.Update<TUpdatable>(TUpdatable updatable)
      {
        throw new NotImplementedException();
      }
    }
    

     

  • 08 Ağustos 2011 Pazartesi 10:33
     
     

    In my solution,there were two projects,and one referenced assembly A.DLL(4.0.xxxxx),and another referenced A.DLL(5.0.xxxxx).

    And then there was an error like this:CA0001:....:The following error was encountered while reading module 'xxxx':Could not resolve member reference:.....

    I searched the error in google,and find one solution is to change the item AssemblyReferenceResolveMode from StrongName to StrongNameIgnoringVersion in FxCop.exe.config file.

    But there was still the error when fxcop my codes.