How to suppress code analysis error CA0052 on Host project?

Topics: General Discussion Forum
Mar 21, 2007 at 4:17 PM
Hi there

We are using TFS Code Analysis while developing web services that use the Web Service Factory. With the standard implementation the Host website project only contains the asmx and other config files as the implementation is held in another VS project.

When we attempt to run code analysis on the whole solution due to the TFS Checkin policies on the project we get the error "Error 17 CA0052 : No targets were selected. C:\...\xxx.Host\", we assume this is because there are no code targets to analyse in the Host project but it still logs it as an error rather than a warning a therefore the policy needs to be overridden to check in to TFS.

But how is this done? It should be possible using a global suppression file, but what should this file look like, and how should it be included in the host project? The host project has no project file.

Best regards

Michael Brandt Lassen
3F, Denmark
Developer
Mar 21, 2007 at 11:23 PM
Your assumption is correct, regarding the missing target for code analysis in host project.
An effective solution to this problem might be adding implementation to the Host project (actually a blank file in App_Code folder would be enough) and this error will go away since the Host project will have a build output which Code Analysis can analyze.

Mar 22, 2007 at 10:20 AM
Hi charlyfriend

Your solution worked just fine. Thanks a bunch!

Though, I also had to enable code analysis in the build properties of the Host project.

best regards,

Michael Brandt Lassen
3F, Denmark