Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Problems with code analysis after upgrade
strudso
#1 Posted : Thursday, April 4, 2013 12:28:12 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/4/2013(UTC)
Posts: 1

I get these in my NCrunchTest window after upgrade to 1.45.0.12:
(0)#0: CA0001 : Rule=Microsoft.Naming#CA1702, Target=Dba.Core.DomainEvents.IHandler : Unexpected proofing tool error code: 0x8E -- 142.
(0)#1: CA0001 : Rule=Microsoft.Naming#CA1714, Target=Dba.Core.EnumerationUtility : Unexpected proofing tool error code: 0x8E -- 142.
(0)#2: CA0001 : Rule=Microsoft.Naming#CA1704, Target=Dba.Contracts.DealerDataContract : Unexpected proofing tool error code: 0x8E -- 142.
(0)#3: CA0001 : Rule=Microsoft.Naming#CA1710, Target=Dba.Core.DomainEvents.ICommand : Unexpected proofing tool error code: 0x8E -- 142.
(0)#4: CA0001 : Rule=Microsoft.Naming#CA1720, Target=Dba.Core.DomainEvents.ICommandQueryHandler`2.#Handle(!0) : Unexpected proofing tool error code: 0x8E -- 142.
(0)#5: CA0001 : Rule=Microsoft.Naming#CA1707, Target=Dba.Core.DomainEvents.ICommand : Unexpected proofing tool error code: 0x8E -- 142.
(0)#6: CA0001 : Rule=Microsoft.Naming#CA1711, Target=Dba.Contracts.DealerDataContract : Unexpected proofing tool error code: 0x8E -- 142.
(0)#7: CA0001 : Rule=Microsoft.Naming#CA1716, Target=Dba.Core.DomainEvents.IHandler`1 : Unexpected proofing tool error code: 0x8E -- 142.
(0)#8: CA0001 : Rule=Microsoft.Naming#CA1717, Target=Dba.Core.EnumerationConverter : Unexpected proofing tool error code: 0x8E -- 142.
(0)#9: CA0001 : Rule=Microsoft.Naming#CA1726, Target=Dba.Core.DomainEvents.IHandler`1 : Unexpected proofing tool error code: 0x8E -- 142.

Anyone else? or ideas?
Remco
#2 Posted : Thursday, April 4, 2013 10:04:04 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Hi, thanks for sharing this issue.

The 1.45 release included support for custom code analysis rule sets. Do you have a custom ruleset for this project or solution? I'm wondering if this may be the reason for this problem now surfacing (where it didn't with 1.44).

The cause of the problem may be related to NCrunch's instrumentation. Does turning off the 'Instrument output assembly' for the project remove the errors?
bmorien
#3 Posted : Monday, April 29, 2013 8:18:34 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/29/2013(UTC)
Posts: 4
Location: United States of America

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
I have upgraded to 1.45 today and I am seeing a similar issue. nCrunch is not finding the rulesets specified in our .csproj file, which live elsewhere in our source tree. CA is working correctly for VS and msbuild builds.

(0)#0: CA0053 : Failed to load rules file 'C:\Users\bremor\AppData\Local\NCrunch\3096\32\Security\RuleSets\Xbox\..\..\FxCop\Rules\SDL\': Could not find rule file C:\Users\bremor\AppData\Local\NCrunch\3096\32\Security\RuleSets\Xbox\..\..\FxCop\Rules\SDL\
Code Analysis detected errors. See Code Analysis results window or log file for details.

The relative location for the rule set in the .csproj file is:
<CodeAnalysisRuleSet>..\..\Security\RuleSets\Xbox\SDLASPNETMinimumRules.ruleset</CodeAnalysisRuleSet>

Any ideas?
Thanks!
- Brett
Remco
#4 Posted : Monday, April 29, 2013 10:14:58 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Hi Brett,

Thanks for sharing this issue! Something seems strange about this error message - it's like NCrunch is missing a directory being referenced from your ruleset file? Can you check whether the ruleset file is being copied into the NCrunch workspace? You can do this by right clicking on the failed build, then choosing 'Advanced->Browse to workspace'. If it isn't there, you should be able to work around this using the Additional files to include configuration setting to tell NCrunch about the file.

If the ruleset file is already in your workspace, I'm wondering if you can tell me a bit more about the structure of your rulesets. Do you have an SDK included in your project/solution using a relative path? If so, you may need to let NCrunch know about it using the Additional files to include configuration setting.

Cheers,

Remco
bmorien
#5 Posted : Tuesday, April 30, 2013 12:45:06 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/29/2013(UTC)
Posts: 4
Location: United States of America

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
It looks like nCrunch is finding the ruleset properly, and copying it into the correct location in the AppData folder, but it's having issues finding the rules dlls referenced in the ruleset. We may be a unique case in that our rules dlls aren't in the GAC, but in our source tree.

Let me know what other info would be helpful, but I would be happy with a short-term fix which lets me disable code analysis while a longer term fix is being developed...

- Brett
Remco
#6 Posted : Tuesday, April 30, 2013 6:38:01 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Hi Brett,

Making sure the DLLs are all included using the 'Additional files to include' setting should allow you to work around this. The problem is that NCrunch doesn't have enough of an understanding of your rulesets to identify their DLL dependency, so it just leaves the DLLs out of the workspace. If there's any chance I could get a description of how the DLLs are physically referenced from the ruleset (i.e. is this done using XML?) this would be really helping in building a formal solution so that the Additional Files To Include aren't needed.

Cheers,

Remco
bmorien
#7 Posted : Tuesday, April 30, 2013 9:58:44 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/29/2013(UTC)
Posts: 4
Location: United States of America

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
Hey, Remco

I found this in our rules file near the top:
<RuleHintPaths>
<Path>..\..\FxCop\Rules\SDL\</Path>
</RuleHintPaths>

From there, it looks like it scoops up the 2 custom rule dlls our company has for our SDL compliance.

After adding that directory in the Additional Files dialogs of some projects, those started to build and run correctly. Adding that directory at the solution level seems to have fixed it for the whole solution.

Hope that's super useful information!
- Brett
Remco
#8 Posted : Tuesday, April 30, 2013 10:17:06 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Thanks Brett! That's just the information I needed. I'll try to introduce a longer term fix, and hope that the additional files will continue to work for you in the meantime.

Cheers,

Remco
1 user thanked Remco for this useful post.
bmorien on 4/30/2013(UTC)
bmorien
#9 Posted : Tuesday, April 30, 2013 10:47:10 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/29/2013(UTC)
Posts: 4
Location: United States of America

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
You're awesome. I appreciate the speedy responses!
1 user thanked bmorien for this useful post.
Remco on 5/1/2013(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.058 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download