Hi All,
Sometimes when I starts the debug process, it do not stops in my breakpoints. I do the same thing with all my rules, but sometimes all my breakpoints do not work in all my rules....
When it happens, I am forced to create a new project and import all my rules to this new project. It is not a good idea and I'd like to know why it happens and if there is a solution. It happenned 4 times up to now.
I am using fxcop 1.312 with Visual Studio 1.1
Regards,
Marcelo.

Problems with Debug and FxCop
vitalcc
Oliver, we need to constrain discuss of your issue to at most two threads, is that OK with you I've deleted some other content on this issue.
Have you set VS to break on any managed exception Is it possible that your rule is raising an exception at analysis time If so, FxCop will disable it and you wouldn't, therefore, hit any breakpoints in the debugger. What items have you overridden in your rule Have you overridden BeforeAnalysis() Where are you attempting to set breakpoints
Do your rules depend on the existence of any external files Can you run your rule assembly in the stand-alone version of FxCop, or does the FxCop UI tell you that there were exceptions running your rule
RogerH
Hi David,
I made all those steps you've said. But, my problem persists !!!
I have a solution with one project. In this project I created two folders, one to put all my entity rules and the other to put all my dalc rules.
My project has nine rules done, but I can't run all those rules at the same time cause they stops running when I have all together.
When I have up to 7 rules, all the rules runs. But when the number of rules is more than 7, all the rules stops to run. I saw that when I execute the rules in fxcop. My assemblies with errors, pass with zero errors when my project with rules has more than 7 rules inside.
When my project has 7 rules or less, I can execute the rules in fxcop and all message erros appears in the fxcop panels.
I tried to mix my rules, trying to incluse a different group of rules to see if the problem is with an especific one. But, the error occurs every time no matter what you do, no matter what mix of rules you compile in the project. The error is the same: all the rules stops running and my assemblies pass without error which is impossible because I know they have errors.
Please, show me the right way to solve that, cause I have a target date to finish the project but with this problem I can't do no more rules.
Regards,
Marcelo.
systech
Michael,
the assemblies that I send to you have some references and you do not have them... Here, those references are ok.
But I tried with a simple project without references and the erro ocurres.
The possibility to upgrade the fxcop version is out of question. Here, the company, have a great number of projects that other companies develop for it and all them are in 1.1 version and noone have whidbey to do that.
The exceptions that you see in summary are caused by the references, isn't it
This problem I resolved here, adjusting all references.
Let me explain other tests I am doing here. I separate my solution and now I have only the Dalc rules. The other two projects I get off the solution.
In this dalc project I have 5 rules now. If I reduce those rules to 2 with all those rules working. So, I include one more rule, having 3 rules. It continues to work. After, I include one more rule, having 4 the process stops running and some rules do not stops in its breakpoints.
It's really very strange. If I change the order of those rules, and put a different set of rules inside the project, all of them works fine only if this project has 3 rules inside, no matter what rules are.
I will send to you to your email only those rules to see if there are anything wrong inside them... I suppose the error is inside one of them.
Please, do this avaliation for me and return me what you see there.
Thanks,
Marcelo.
Azman
Hi David,
I changed my solution and now I have a lot of projects, each one to aggregate a specific type of rules.
With this kind of solution I have now 3 project, one with 4 rules, one with 2 rules and other with 3 rules.
I have a rule that uses a xml file (embedded resource) with has entity names to use in one rule to validate class names.
Well, this rule now is the only one that do not accepts breakpoints to debbug. Is there any relation with the use of this xml file
This xml file is like:
< xml version="1.0" encoding="utf-8" >
<Entidades>
<Entidade>
<Sigla>REEA</Sigla>
<NomeEntidade>REPRESENTANTEEMPRESAADM</NomeEntidade>
</Entidade>
<Entidade>
<Sigla>TISE</Sigla>
<NomeEntidade>TIPOSERVICO</NomeEntidade>
</Entidade>
...
</Entidades>
What could be happening with this rule that is impossible to stop in breakpoints to debug it
regards,
Marcelo.
Mltronik
That was not the case when I debugged analysis of your binaries. There are several exceptions that are raised while loading them. If you do a standard FxCop analysis of these files, you should see in the analysis summary that exceptions were raised during analysis. This always indicates a serious problem.
In this case, it looks as thought the 1.312 and 1.32 metadata readers can't completely walk your target assemblies, due to some bug. The problem appears to be resolved in 1.35, available at http://www.gotdotnet.com/team/fxcop/. Note that you'll need to compile a whidbey version of your rules to use this version, though you can still analyze v1.1 target binaries.
Are you ignoring missing assembly references during analysis When I tried to run your repro, I get messages stating that ~12 assemblies are missing.
rcodyr
There are two main reasons why your breakpoints might not get hit.
1. Associated symbols (pdb) are not getting loaded:
To see if symbols are getting loaded for your rule assembly, do the following:
If the text states 'No symbols loaded.' then your breakpoints won't be hit. Check the pdb file is in the same directory as your rule assembly.
2. Associated symbols (pdb) are out of date
This happens when you have an pdb that doesn't match up with your assembly.
Try the above and see if that helps
David
John Portnov
I am editing my original post, as this doesn't look like an FxCop issue at all. Marcelo, you need to honor the original casing of our Check method declarations (that is, use 'Check' rather than 'check'). In at least one of your assemblies, vbc.exe appears to have emitted the wrong casing for this item. The result is that FxCop fails to cache your rule properly (it performs a name check against 'Check'). The casing of the method is part of its signature, required to identify the method in the CLR. We will contact the VB compiler team to see if there's a known issue in this area.
In the meantime, though, try using 'Check' in all your rule implementations and let me know how things go.
Marty1066
Ramakrishnan Thangavel
This is a solvable problem, you need to keep digging.
After attaching to FxCop with VS, pull down the Debug menu and select 'Exceptions'. Click the radio button labeled 'Common Language Runtime Exceptions' then click the radio button below labeled 'break into the debugger'. Then click ok.
After this, run your repro. Does the debugger report an unhandled exception
In your previous post, what do you mean by projects FxCop projects or VS projects
Need_Helpss
I am willing to continue looking at this, but you will need to send me the missing assembly references so that I can re-create your repro scenario exactly:
I know I need at least these:
IcatuHartford.Sisp.Entidade.PlanosEProdutos
IcatuHartford.Util.NullableTypes
IcatuHartford.Sisp.Entidade.InfraNegocio
IcatuHartford.Sisp.Entidade.Pessoa
IcatuHartford.Sisp.Dalc.Produtor
IcatuHartford.Sisp.Entidade.Produtor
IcatuHartford.Util.Arquitetura
Microsoft.Practices.EnterpriseLibrary.Data
Microsoft.Practices.EnterpriseLibrary.Common
Microsoft.Practices.EnterpriseLibrary.Configuration
IcatuHartford.Sisp.Dalc.Infranegocio
IcatuHartford.Sisp.Dalc.Pessoa
IcatuHartford.Sisp.Entidade.ControleAcesso
IcatuHartford.Sisp.ProdutoContrato.Datasets
IcatuHartford.Util.Profile
IcatuHartford.Util.Xml
Les26739
Ok Michael !!!
Answering your questions...
1) Have you set VS to break on any managed exception
No. How to do that
2) Is it possible that your rule is raising an exception at analysis time If so, FxCop will disable it and you wouldn't, therefore, hit any breakpoints in the debugger.
All my rules works normally. I have a rule which uses a embedded xml file with names of entities to validade class names. When I use it, the problem happens. But, If I create a project with only this specific rule, everything works fine, and no exceptions is raised.
3) What items have you overridden in your rule
My rules overrides the check methods like below:
Public Overloads Overrides Function check(ByVal namespaceName As String, ByVal types As Microsoft.Cci.TypeNodeList) As ProblemCollection Public Overloads Overrides Function check(ByVal membro As Member) As ProblemCollection Public Overloads Overrides Function Check(ByVal Modulo As Microsoft.cci.Module) As ProblemCollectionAnd so on... My rules are in vb.net, cause is the language the company uses.
4) Have you overridden BeforeAnalysis()
No. The only one method overrided are the check methods
5) Where are you attempting to set breakpoints
I Put breakpoint in the check function assignature.
6) Do your rules depend on the existence of any external files
Only one rule has a xml file used to help in validation. This xml file is an embedded resource, and it is like :
< xml version="1.0" encoding="utf-8" >
<Entidades>
<Entidade>
<Sigla>REEA</Sigla>
<NomeEntidade>REPRESENTANTEEMPRESAADM</NomeEntidade>
</Entidade>
<Entidade>
<Sigla>TISE</Sigla>
<NomeEntidade>TIPOSERVICO</NomeEntidade>
</Entidade>
....
</Entidades>
7) Can you run your rule assembly in the stand-alone version of FxCop, or does the FxCop UI tell you that there were exceptions running your rule
What are you want to say with "FxCop UI tell you that there were exceptions running your rule "
I do not understand your question... All my rules, if are running alone in a project with only then, works great and all breakpoints stops. I created a project with 2 or 3 rules of those 9 rules I have. Every rule works great without any error or exception !!!
Like I said before, I have 9 rules done. But I only runs 7 rules. When I include just one more rule, my problem beggins.
I combined my 7 rules with all the ways. The problem happens when I have more than 7 rules, no matter how many projects I have or the combination of rules I made. It's only necessary to have 8 or more rules inside the project(s) to my problem beggins.
If my solution has 7 or less rules, all my rules works, all breakpoints in all rules stops, all erros appears at fxcop panel.
More than 7 rules, some rules stop runnings (no errors or exceptions appears), some breakpoints do not stop and no errors appears at fxcop panel.
This is my reallity !!! A dark reallity... :(
Thanks,
Marcelo.
Bloke
Hi Michael,
Thanks... I really do not know how the name do not changed to 'Check', as all command in vb code. But, thanks God and You that you find this problem...
Is there a possibility my problem has any relation with it
I changed all my 'check' methods and now everyone is 'Check'.
Thanks,
Marcelo.
double americano
Nick and I got in touch with the VB compiler tech lead, who verified this is a known issue with the v1.1 VB compiler. It's definitely been fixed in v2.0. In the meantime, be sure to honor the original casing defined by FxCop (that is, 'Check' and not 'check) and you should be fine.
Mark53
Hi Michael,
I made it.. checked 'Exceptions' radio and 'break into the debugger' radio too.
I runs the fxcop analyzes and nothing happens... No error or execption is launched.
I my previous post, when I say 'Project' is VS project, cause I have a VS solution with 3 projects inside. I have a fxcopy Project too, which has the dll rules.
Thanks,
Marcelo.