Running FxCop Build Step as a Build Configuration Dependency

I am attempting to set up FxCop and StyleCop to run as Build Steps in a separate Build Configuration from my main build to keep my build times fast.

I have set up a Snapshot Dependency on my main Development build, however, when I attempt to run the FxCop Build Step in my dependent build configuration, the FxCop Build Step says "Cannot find any matching assemblies".

When I set up the FxCop step directly in my main build configuration, the pattern works just fine, but fails when I move it to a build dependency.

Can you tell me what I am doing wrong and what I need to do get this to work?

Thanks.  

8 comments
Comment actions Permalink

Hi Samir,

To make it work you should publish assemblies generated by Development build as artifacts and download them using artifact dependency in FxCop build.

0
Comment actions Permalink

Can you provide an example of how to do this as well as the syntax that needs to be used for publishing artifacts?  I am using the same build directory as my original build configuration so I guess I don't understand how artifacts need to be published since they are running from the existing directory.

Please clarify.

Thanks.

0
Comment actions Permalink

Do you use custom checkout directory and run builds on the same agent?
It is not recommended to use custom checkout directory. To publish artifacts you should specify Artifacts path on Build configuration > General setting page. Artifacts will be uploaded to the server. For FxCop build configuration configure artifact dependency, so needed files are downloaded to the agent before FxCop build starts.

0
Comment actions Permalink

I am not using a custom checkout directory, but I am building on the same agent.  Because I am also using a snapshot dependency I have the build directory configured to run from the same build directory as other build configuration.

0
Comment actions Permalink

"Run on the same agent" option ensures that builds run on the same agent, but not necessarily in the same folder. Please read about Checkout process.
Are you sure that two builds run in the same checkout directory?

0
Comment actions Permalink

My other build configuration is not even attached to a version control setting (VCS).  It is a plain old build configuration with Build Steps.  No checkout should be occurring whatsoever.

0
Comment actions Permalink

By default build working directory is the same as checkout directory (even though there is no actual checkout performed).

You can check where the build runs in build log:

Checkout directory: /Users/user_name/Documents/TeamCity_9.0.1/buildAgent/work/b34d755dab197abc

Starting: /Users/user_name/Documents/TeamCity_9.0.1/buildAgent/temp/agentTmp/custom_script7267156148201325575

in directory: /Users/user_name/Documents/TeamCity_9.0.1/buildAgent/work/b34d755dab197abc

0
Comment actions Permalink

I was able to modify the Checkout directory in Version Control Settings to use the same checkout directory as the build configuration dependency.

That seemed to have fixed the issue.

Thanks!

0

Please sign in to leave a comment.