Rob Robertson

Here's the output from the buildlog.txt. Everything compiles fine, but the command line for fxcopcmd isn't quite right. I can run this from the command line by replacing the /r: parameter in quotation marks or remove the /d and /r params.

Any ideas on how to place its value in quotation marks

Target RunCodeAnalysis:

Running Code Analysis...

C:\Program Files\Microsoft Visual Studio 8\Team Tools\Static Analysis Tools\FxCop\FxCopCmd.exe /o:"d:\build4\HCMS\Sample3\Binaries\Release\SampleBusinessLayer.dll.CodeAnalysisLog.xml" /f:"d:\build4\HCMS\Sample3\Binaries\Release\SampleBusinessLayer.dll" /d:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727" /r:C:\Program Files\Microsoft Visual Studio 8\Team Tools\Static Analysis Tools\FxCop\\rules

Could not load SampleBusinessLayer.dll.

* Analysis was not performed; at least one valid rules assembly and one valid

target file must be specified.

* 1 total analysis engine exceptions.

MSBUILD : error : CA0055 : Could not load SampleBusinessLayer.dll.

MSBUILD : error : CA0052 : No targets were selected.

Code Analysis Complete -- 2 error(s), 0 warning(s)



Re: Team Foundation Server - Build Automation Target RunCodeAnalysis - Analysis was not performed; at least one valid rules assembly and...

Jason Pricket - MSFT

Hi Rob,

I think you probably want the forum that deals with FxCop issues:

http://forums.microsoft.com/MSDN/ShowForum.aspx ForumID=98&SiteID=1

I know this sounds like a build issue, but that team should know more about how the build script is generated for Code Analysis (i.e. FxCop). It looks like the generated build script is wrong, but I can't be sure where it gets the path information.

Hope that helps,

Jason





Re: Team Foundation Server - Build Automation Target RunCodeAnalysis - Analysis was not performed; at least one valid rules assembly and...

JohnM12

I'm having this same error also AND it only occurs on my Orcas TB Beta 2 box. It works fine in VS '05 SP1 and also on TB '05 SP1.

It looks like a Orcas TB issue to me since it only fails there.

It fails on all of my projects in the solution. It looks like an missing method in FxCop.

Here's an example of one of the CA XML log files:

<Exceptions>
<Exception Keyword="CA0055" Kind="AssemblyLoad">
<Type>Microsoft.FxCop.Common.AssemblyLoadException</Type>
<ExceptionMessage>Could not load SetRegistry.exe.</ExceptionMessage>
<InnerType>System.MissingMethodException</InnerType>
<InnerExceptionMessage>Method not found: 'Void Microsoft.FxCop.Sdk.Introspection.CallGraph.RecordStringConstantLoad(System.String)'.</InnerExceptionMessage>
<InnerStackTrace> at Microsoft.FxCop.Engines.Introspection.LoadVisitor.ReviewAttributes(AttributeList attributes, Node node)
at Microsoft.FxCop.Engines.Introspection.LoadVisitor.VisitModule(Module module, TargetModule target)
at Microsoft.FxCop.Engines.Introspection.BaseVisitor.VisitAssembly(AssemblyNode assembly, TargetFile target)
at Microsoft.FxCop.Engines.Introspection.LoadVisitor.VisitAssembly(AssemblyNode assembly, TargetFile target)
at Microsoft.FxCop.Engines.Introspection.LoadVisitor.Load(TargetFile target, Boolean buildTree, Boolean queueItems, AssemblyNode loadedAssembly)
at Microsoft.FxCop.Engines.Introspection.IntrospectionAnalysisEngine.LoadTargets(TargetFile target)
at Microsoft.FxCop.Common.EngineManager.LoadTargets(TargetFile target, Boolean resetCounts, String loadEngine)</InnerStackTrace>
</Exception>
<Exception Keyword="CA0052" Kind="Engine">
<Type>Microsoft.FxCop.Sdk.FxCopException</Type>
<ExceptionMessage>No targets were selected.</ExceptionMessage>
</Exception>
</Exceptions>





Re: Team Foundation Server - Build Automation Target RunCodeAnalysis - Analysis was not performed; at least one valid rules assembly and...

JohnM12

Never mind... I requested our RSA to reinstall VS '05 SP1 on the build machine.

It resolved the problem.





Re: Team Foundation Server - Build Automation Target RunCodeAnalysis - Analysis was not performed; at least one valid rules assembly and...

Rob Robertson

Yep, we re-installed SP1 and it took care of everything...





Re: Team Foundation Server - Build Automation Target RunCodeAnalysis - Analysis was not performed; at least one valid rules assembly and...

Carolyn Johnston

I am trying to fix this problem by installing SP1 for VS, but the copy I'm trying to install has a digital signature problem in one of it's little files so the installation can't finish. Is this a problem that anyone else has encountered




Re: Team Foundation Server - Build Automation Target RunCodeAnalysis - Analysis was not performed; at least one valid rules assembly and...

JohnM12

Nope. My copy of SP1 worked fine. Perhaps your copy is corrupted





Re: Team Foundation Server - Build Automation Target RunCodeAnalysis - Analysis was not performed; at least one valid rules assembly and...

Jason Pricket - MSFT

Here's a response that Aaron shared with someone else:

There¡¯s a bug in the 8.0 CodeAnalysis task - it should indeed be putting quotes around the path. This is fixed in VS2008 - not sure if/when it got fixed in VS2005 (i.e. possibly in a service pack). You can work around this issue manually by adding the quotes to the CodeAnalysis targets file. Open up C:\Program Files\MSBuild\Microsoft\VisualStudio\v8.0\CodeAnalysis\Microsoft.CodeAnalysis.targets and replace this line:

<CodeAnalysisRuleAssemblies Condition="'$(CodeAnalysisRuleAssemblies)'=='' and '$(CodeAnalysisPath)'!=''">$(CodeAnalysisPath)\Rules</CodeAnalysisRuleAssemblies>

With this one:

<CodeAnalysisRuleAssemblies Condition="'$(CodeAnalysisRuleAssemblies)'=='' and '$(CodeAnalysisPath)'!=''">"$(CodeAnalysisPath)\Rules"</CodeAnalysisRuleAssemblies>

Hope that helps,

Jason