Ryan Davis commented on Bug JENKINS-18151

I'm experiencing this too, and figured out a solution. I needed to disable saving messages.

http://social.msdn.microsoft.com/Forums/en-US/60bc9dbf-5557-46d4-8905-d850286b8787/could-not-import-all-messages-error-supression has a good description of the problem and solution, but I'll repeat it here.

I'm using an .fxcop file to configure the rules, and occasionally open/edit that using FXCop directly. In my jenkins configuration, I add a command line argument to load up my .fxcop file. Using the fxcop defaults, it's trying to save the warnings in the fxcop file every time, and fxcopcmd will emit warnings that trigger build instability.

To fix it, in my fxcop file (which is XML), I changed SaveMessages/Project/Status to "Excluded", which might not be the best setting, but it made it work for me. In Fxcop GUI this is done via:

  • Open your project in FxCop
  • Choose Project -> Project Options
  • Under Save Messages and next to Project uncheck the Active checkbox
  • click OK
full output
Started by user (null)
Building remotely on MY_JENKINS_SLAVE in workspace C:\Jenkins\workspace\MY_PROJECT
Checkout:MY_PROJECT / C:\Jenkins\workspace\MY_PROJECT - hudson.remoting.Channel@3ecfea4e:MY_JENKINS_SLAVE
Using strategy: Default
Last Built Revision: Revision 655c79fcdeaef3d871d0dfe941f083e83e475b68 (origin/master)
Fetching changes from 1 remote Git repository
Fetching upstream changes from origin
Commencing build of Revision bb32fd2e656441de1f65daf3a1019ad20a7ba858 (origin/master)
Checking out Revision bb32fd2e656441de1f65daf3a1019ad20a7ba858 (origin/master)
Cleaning workspace
Resetting working tree
[MY_PROJECT] $ cmd /c call C:\Users\jenkins\AppData\Local\Temp\hudson2073588205894679312.bat

C:\Jenkins\workspace\MY_PROJECT>c:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe MY_PROJECT.proj /t:test 
Microsoft (R) Build Engine version 4.0.30319.17929
[Microsoft .NET Framework, version 4.0.30319.18052]
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 7/29/2013 5:01:07 PM.
... MSBUILD OUTPUT COMPILING AND RUNNING NUNIT ...

Build succeeded.

  C:\Jenkins\workspace\MY_PROJECT\src\MY_WEBSITE\MY_WEBSITE.csproj(271,3): warning MSB4011: "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" cannot be imported again. It was already imported at "C:\Jenkins\workspace\MY_PROJECT\src\MY_WEBSITE\MY_WEBSITE.csproj (270,3)". This is most likely a build authoring error. This subsequent import will be ignored. 

    1 Warning(s)
    0 Error(s)

Time Elapsed 00:00:10.58

C:\Jenkins\workspace\MY_PROJECT>exit 0 
Path To FxCopCmd.exe: C:\Program Files (x86)\Microsoft Fxcop 10.0\FxCopCmd.exe
Executing FxCop: cmd.exe /C C:\Users\jenkins\AppData\Local\Temp\fxcop_runner9006884407026696209.bat && exit %ERRORLEVEL%
[MY_PROJECT] $ cmd.exe /C C:\Users\jenkins\AppData\Local\Temp\fxcop_runner9006884407026696209.bat && exit %ERRORLEVEL%

C:\Jenkins\workspace\MY_PROJECT>"C:\Program Files (x86)\Microsoft Fxcop 10.0\FxCopCmd.exe" /out:"fxcop.xml" /ignoregeneratedcode /forceoutput /p:src\MY_PROJECT.FxCop 
Microsoft (R) FxCop Command-Line Tool, Version 10.0 (10.0.30319.1) X86
Copyright (C) Microsoft Corporation, All Rights Reserved.

Loading src\MY_PROJECT.FxCop...
Loaded DesignRules.dll...
Loaded GlobalizationRules.dll...
Loaded MobilityRules.dll...
Loaded NamingRules.dll...
Loaded PerformanceRules.dll...
Loaded PortabilityRules.dll...
Loaded SecurityRules.dll...
Loaded SecurityTransparencyRules.dll...
Loaded UsageRules.dll...
Loaded MY_WEBSITE.dll...
Loaded MY_PROJECT.dll...
There were non-critical errors loading FxCop project:
* Could not import all messages.
* End of project load errors.
Initializing Introspection engine...
Analyzing...
Analysis Complete.
Writing 31 messages...
Writing report to C:\Jenkins\workspace\MY_PROJECT\fxcop.xml...
Done:00:00:03.4706186
Build step 'FxCop exec.' changed build result to UNSTABLE
Recording NUnit tests results
Jabber notifier plugin: Sending notification to: [email protected]
Jabber notifier plugin: Notifying suspects
Jabber notifier plugin: Sending notification to suspect: [email protected]
Jabber notifier plugin: Notifying culprits
Finished: UNSTABLE

After changing my fxcop config I don't get these messages:

There were non-critical errors loading FxCop project:
* Could not import all messages.
* End of project load errors.
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply via email to