FxCop 1.36 with VS2005 -Could not resolve member reference
-
Montag, 18. Januar 2010 15:51CA0001 : The following error was encountered while reading module 'XXXXX.XXXXXXX.XXXXXX': Could not resolve member reference: XXXXX.XXX.XXXX.Status::get_StatusFlag
Thanks n RegardsVenkat Duvvuri
Alle Antworten
-
Dienstag, 19. Januar 2010 01:26Moderator
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! -
Dienstag, 19. Januar 2010 04:23Hi 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 RegardsVenkat Duvvuri
-
Dienstag, 19. Januar 2010 06:45Moderator
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! -
Dienstag, 19. Januar 2010 09:48The 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..
-
Mittwoch, 20. Januar 2010 12:10Moderator
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!- Als Antwort markiert VenkatDuvvuri Mittwoch, 20. Januar 2010 13:20
- Tag als Antwort aufgehoben Roahn LuoModerator Dienstag, 5. Oktober 2010 06:31
-
Dienstag, 5. Oktober 2010 06:34Moderator
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! -
Mittwoch, 22. Dezember 2010 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.
-
Mittwoch, 22. Dezember 2010 13:14
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.
-
Mittwoch, 22. Dezember 2010 16:44
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(); } }
-
Montag, 8. August 2011 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.

