2011-09-16 11 views
7

Tener registro siguiente, cuando se construye un .NET C# Solución: (interruptor detallado en config FxCop)sonar sistema de C# eco: código de error FxCop 521

Al ejecutar el comando fxcopcmd.exe por sí solo funciona perfectamente. ¿Por qué no funciona con sonar-runner.bat?

15-Sep-2011 03:05:37 [DEBUG] Executing FxCop program... 
15-Sep-2011 03:05:37 [DEBUG] No assembly specified: will look into 'csproj' files to find which should be analyzed. 
15-Sep-2011 03:05:37 [DEBUG] - Found C:\b\SH-SHN-JOB1\Source\SomeSystem.Client\Bin\Release\Company.SomeSystem.Client.dll 
15-Sep-2011 03:05:37 [DEBUG] Using C:\b\SH-SHN-JOB1\Source\SomeSystem.Client as base dir when searching FxCop reference directories 
15-Sep-2011 03:05:37 [DEBUG] - FxCop program   : C:\Program Files\Microsoft FxCop 10.0\FxCopCmd.exe 
15-Sep-2011 03:05:37 [DEBUG] - Project file   : C:\b\SH-SHN-JOB1\Source\SomeSystem.Client\.sonar\sonar.FxCop 
15-Sep-2011 03:05:37 [DEBUG] - Report file   : C:\b\SH-SHN-JOB1\Source\SomeSystem.Client\.sonar\fxcop-report.xml 
15-Sep-2011 03:05:37 [DEBUG] - Scanned assemblies : 
15-Sep-2011 03:05:37 [DEBUG]  o C:\b\SH-SHN-JOB1\Source\SomeSystem.Client\Bin\Release\Company.SomeSystem.Client.dll 
15-Sep-2011 03:05:37 [DEBUG] - Assembly dependencies : 
15-Sep-2011 03:05:37 [DEBUG]  o [Silverlight] C:\Program Files\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0 
15-Sep-2011 03:05:37 [DEBUG] - Ignoring generated code 
15-Sep-2011 03:05:37 [DEBUG] Executing command: C:\Program Files\Microsoft FxCop 10.0\FxCopCmd.exe /p:C:\b\SH-SHN-JOB1\Source\SomeSystem.Client\.sonar\sonar.FxCop /out:C:\b\SH-SHN-JOB1\Source\SomeSystem.Client\.sonar\fxcop-report.xml /f:C:\b\SH-SHN-JOB1\Source\SomeSystem.Client\Bin\Release\Company.SomeSystem.Client.dll /d:C:\Program Files\Reference  Assemblies\Microsoft\Framework\Silverlight\v4.0 /igc /to:600 /gac 
15-Sep-2011 03:05:37 [INFO] Microsoft (R) FxCop Command-Line Tool, Version 10.0 (10.0.30319.1) X86 
15-Sep-2011 03:05:37 [INFO] Copyright (C) Microsoft Corporation, All Rights Reserved. 
15-Sep-2011 03:05:37 [INFO] 
15-Sep-2011 03:05:37 [INFO] Loading C:\b\SH-SHN-JOB1\Source\SomeSystem.Client\.sonar\sonar.FxCop... 
15-Sep-2011 03:05:37 [INFO] Loaded DesignRules.dll... 
15-Sep-2011 03:05:37 [INFO] Loaded GlobalizationRules.dll... 
15-Sep-2011 03:05:37 [INFO] Loaded NamingRules.dll... 
15-Sep-2011 03:05:37 [INFO] Loaded PerformanceRules.dll... 
15-Sep-2011 03:05:37 [INFO] Loading C:\b\SH-SHN-JOB1\Source\SomeSystem.Client\Bin\Release\Company.SomeSystem.Client.dll 
15-Sep-2011 03:05:37 [INFO] Using system files at: C:\Program Files\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\mscorlib.dll. 
15-Sep-2011 03:05:37 [INFO] Resolver hooked up for: 'C:\Program Files\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\mscorlib.dll'. 
15-Sep-2011 03:05:37 [INFO] Resolver hooked up for: 'C:\b\SH-SHN-JOB1\Source\SomeSystem.Client\Bin\Release\Company.SomeSystem.Client.dll'. 
15-Sep-2011 03:05:37 [INFO] Unresolved : 'Company.SomeSystem.Client' reference to Microsoft.Practices.Prism, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35. 
15-Sep-2011 03:05:37 [INFO] Could not resolve reference to Microsoft.Practices.Prism. 
15-Sep-2011 03:05:37 [INFO] The following error was encountered while reading module 'Company.SomeSystem.Client': Assembly reference cannot be resolved: Microsoft.Practices.Prism,  Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35. 
15-Sep-2011 03:05:37 [INFO]  at Microsoft.FxCop.Sdk.Reader.HandleError(ModuleNode mod, String errorMessage) 
15-Sep-2011 03:05:37 [INFO]  at Microsoft.FxCop.Sdk.Reader.GetAssemblyFromReference(AssemblyReference assemblyReference) 
15-Sep-2011 03:05:37 [INFO]  at Microsoft.FxCop.Sdk.AssemblyReference.get_Assembly() 
15-Sep-2011 03:05:37 [INFO]  at Microsoft.FxCop.Sdk.Reader.GetTypeFromRef(Int32 i, Boolean expectStruct) 
15-Sep-2011 03:05:37 [INFO]  at Microsoft.FxCop.Sdk.Reader.GetTypeIfNotGenericInstance(Int32 codedIndex) 
15-Sep-2011 03:05:37 [INFO]  at Microsoft.FxCop.Sdk.Reader.ConstructCorrectTypeNodeSubclass(Int32 i, Identifier namesp, Int32 firstInterfaceIndex, Int32 lastInterfaceIndex, TypeFlags flags, InterfaceCollection interfaces, Int32 baseTypeCodedIndex, Boolean isSystemEnum) 
15-Sep-2011 03:05:37 [INFO]  at Microsoft.FxCop.Sdk.Reader.GetTypeFromDefHelper(Int32 i) 
15-Sep-2011 03:05:37 [INFO]  at Microsoft.FxCop.Sdk.Reader.GetTypeFromDef(Int32 i) 
15-Sep-2011 03:05:37 [INFO]  at Microsoft.FxCop.Sdk.Reader.GetTypeList(ModuleNode module) 
15-Sep-2011 03:05:37 [INFO]  at Microsoft.FxCop.Sdk.ModuleNode.get_Types() 
15-Sep-2011 03:05:37 [INFO]  at Microsoft.FxCop.Sdk.LanguageManager.GetFileName(ModuleNode module) 
15-Sep-2011 03:05:37 [INFO]  at Microsoft.FxCop.Sdk.LanguageManager.GetSourceLanguageFromSymbols(ModuleNode module) 
15-Sep-2011 03:05:37 [INFO]  at Microsoft.FxCop.Sdk.LanguageManager.GetSourceLanguage(ModuleNode module) 
15-Sep-2011 03:05:37 [INFO]  at Microsoft.FxCop.Engines.Introspection.DisplayFormatter.GetNameProvider(ModuleNode module) 
15-Sep-2011 03:05:37 [INFO]  at Microsoft.FxCop.Engines.Introspection.DisplayFormatter.GetDisplayName(Node node) 
15-Sep-2011 03:05:37 [INFO]  at Microsoft.FxCop.Engines.Introspection.LoadVisitor.FindTargetModule(ModuleNode module, TargetModuleDictionary targets) 
15-Sep-2011 03:05:37 [INFO]  at Microsoft.FxCop.Engines.Introspection.BaseVisitor.VisitAssembly(AssemblyNode assembly, TargetFile target) 
15-Sep-2011 03:05:37 [INFO]  at Microsoft.FxCop.Engines.Introspection.LoadVisitor.VisitAssembly(AssemblyNode assembly, TargetFile target) 
15-Sep-2011 03:05:37 [INFO]  at Microsoft.FxCop.Engines.Introspection.LoadVisitor.Load(TargetFile target, Boolean buildTree, Boolean queueItems, AssemblyNode loadedAssembly) 
15-Sep-2011 03:05:37 [INFO]  at Microsoft.FxCop.Engines.Introspection.IntrospectionAnalysisEngine.LoadTargets(TargetFile target) 
15-Sep-2011 03:05:37 [INFO]  at Microsoft.FxCop.Common.EngineManager.LoadTargets(TargetFile target, Boolean resetCounts, String loadEngine) 
15-Sep-2011 03:05:37 [INFO] Could not load C:\b\SH-SHN-JOB1\Source\SomeSystem.Client\Bin\Release\Company.SomeSystem.Client.dll. 
15-Sep-2011 03:05:37 [INFO] No targets were selected. 
15-Sep-2011 03:05:37 [INFO] 
15-Sep-2011 03:05:37 [INFO] NOTE: One or more referenced assemblies could not be found. Use the '/directory' or '/reference' switch to specify additional assembly reference search paths. 
15-Sep-2011 03:05:37 [INFO] 
15-Sep-2011 03:05:37 [INFO] Could not load C:\b\SH-SHN-JOB1\Source\SomeSystem.Client\Bin\Release\Company.SomeSystem.Client.dll. 
15-Sep-2011 03:05:37 [INFO] * Analysis was not performed; at least one valid rules assembly and one valid 
15-Sep-2011 03:05:37 [INFO] target file must be specified. 
15-Sep-2011 03:05:37 [INFO] * 2 total analysis engine exceptions. 
15-Sep-2011 03:05:37 [INFO] Writing report to C:\b\SH-SHN-JOB1\Source\SomeSystem.Client\.sonar\fxcop-report.xml... 
15-Sep-2011 03:05:37 [INFO] Done:00:00:00.6876672 
15-Sep-2011 03:05:38 [DEBUG] JDBC Driver [Proxy: [email protected]] deregistered 
15-Sep-2011 03:05:38 [DEBUG] To prevent a memory leak, the JDBC Driver [com.mysql.jdbc.Driver] has been forcibly deregistered 
15-Sep-2011 03:05:38 [DEBUG] Delete temporary directories 
15-Sep-2011 03:05:38 [DEBUG] Delete temporary directory: C:\Temp\sonar-batch48894413591140935345849622192274996 
15-Sep-2011 03:05:38 [DEBUG] Delete temporary directory: C:\Temp\sonar-batch67144837301840862745763165847723383 
15-Sep-2011 03:05:38 Exception in thread "main" org.sonar.batch.bootstrapper.BootstrapException: org.sonar.api.utils.SonarException: FxCop execution failed. 
15-Sep-2011 03:05:38   at org.sonar.runner.Runner.delegateExecution(Runner.java:155) 
15-Sep-2011 03:05:38   at org.sonar.runner.Runner.execute(Runner.java:58) 
15-Sep-2011 03:05:38   at org.sonar.runner.Main.main(Main.java:52) 
15-Sep-2011 03:05:38 Caused by: org.sonar.api.utils.SonarException: FxCop execution failed. 
15-Sep-2011 03:05:38   at org.sonar.plugins.csharp.fxcop.FxCopSensor.analyse(FxCopSensor.java:113) 
15-Sep-2011 03:05:38   at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:64) 
15-Sep-2011 03:05:38   at org.sonar.batch.phases.Phases.execute(Phases.java:93) 
15-Sep-2011 03:05:38   at org.sonar.batch.bootstrap.ProjectModule.doStart(ProjectModule.java:143) 
15-Sep-2011 03:05:38   at org.sonar.batch.bootstrap.Module.start(Module.java:89) 
15-Sep-2011 03:05:38   at org.sonar.batch.bootstrap.BatchModule.analyze(BatchModule.java:110) 
15-Sep-2011 03:05:38   at org.sonar.batch.bootstrap.BatchModule.analyze(BatchModule.java:105) 
15-Sep-2011 03:05:38   at org.sonar.batch.bootstrap.BatchModule.doStart(BatchModule.java:100) 
15-Sep-2011 03:05:38   at org.sonar.batch.bootstrap.Module.start(Module.java:89) 
15-Sep-2011 03:05:38   at org.sonar.batch.bootstrap.BootstrapModule.doStart(BootstrapModule.java:96) 
15-Sep-2011 03:05:38   at org.sonar.batch.bootstrap.Module.start(Module.java:89) 
15-Sep-2011 03:05:38   at org.sonar.batch.Batch.execute(Batch.java:74) 
15-Sep-2011 03:05:38   at org.sonar.runner.Launcher.executeBatch(Launcher.java:60) 
15-Sep-2011 03:05:38   at org.sonar.runner.Launcher.execute(Launcher.java:53) 
15-Sep-2011 03:05:38   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
15-Sep-2011 03:05:38   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
15-Sep-2011 03:05:38   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
15-Sep-2011 03:05:38   at java.lang.reflect.Method.invoke(Unknown Source) 
15-Sep-2011 03:05:38   at org.sonar.runner.Runner.delegateExecution(Runner.java:152) 
15-Sep-2011 03:05:38   ... 2 more 
15-Sep-2011 03:05:38 Caused by: org.sonar.dotnet.tools.fxcop.FxCopException: FxCop execution failed with return code '521'. Check FxCop documentation for more information. 
15-Sep-2011 03:05:38   at org.sonar.dotnet.tools.fxcop.FxCopRunner.execute(FxCopRunner.java:100) 
15-Sep-2011 03:05:38   at org.sonar.plugins.csharp.fxcop.FxCopSensor.launchFxCop(FxCopSensor.java:151) 
15-Sep-2011 03:05:38   at org.sonar.plugins.csharp.fxcop.FxCopSensor.analyse(FxCopSensor.java:111) 
15-Sep-2011 03:05:38   ... 20 more 

Respuesta

1

¿Ha intentado especificar la ubicación del prisma usando la tecla "sonar.fxcop.assemblyDependencyDirectories" tal como se explica en el wiki oficial (*)?

De todos modos se debe pedir ayuda en la lista de correo del usuario (**) y enviar informaciones tales como su archivo sln y la salida completa de "sonar mvn: sónar -X"

* http://docs.codehaus.org/display/SONAR/sonar-csharp-fxcop-plugin

** http://www.sonarsource.org/support/support/

+0

sonar.fxcop.assemblyDependencyDirectories = $ (Dir SolutionDir) /../ Lib/**/*. Dll no funciona para mí - Siempre dice recurso no encontrado, incluso con rutas absolutas. Obligará a nuestros desarrolladores a establecer CopyLocal = true para las dependencias de lib para garantizar que estén en OutDir. – mawl

+0

De hecho, los patrones comodín no son compatibles con la versión 1.0. Voy a lanzar la versión 1.1 muy pronto, la primera semana de octubre, espero. –

Cuestiones relacionadas