Prevent Code Analysis When Testing Hosted Apps Providers

I am on a SharePoint project that has a dozen hosting providers.

For those unfamiliar, PHAs are mostly fancy MVC web applications, but they have an additional "custom" project that is added to the solution containing the application manifest used by SharePoint (sort of reminiscent of the old VDPROJ project types). This special type of project is only used when packaging an application for SharePoint consumption, it serves no other purpose and therefore does not need to generate output such as a DLL or EXE (except when creating a deployment package, but this is not relevant to this chain).

I am having a problem with Visual Studio while doing code analysis on all PHAs because the PHA application project does not create a DLL. The analysis does not start and reports errors, it has a hard failure because it expects a special application project to generate a DLL and that the DLL is not physically found. This prevents code validation even before the checkbox "Enable code analysis on assembly" is checked or not (which is not the case, if you are interested). The only thing I get are two error messages like this person at CodePlex had :

CA0052  Error Running Code Analysis CA0052: No targets were selected.   [Errors and Warnings]   (Global)     
CA0055  Error Running Code Analysis CA0055 : * Could not load file: 'bin\Debug\xxxxx.dll'.  [Errors and Warnings]   (Global)

      

I even went over to creating a completely new PHA project from scratch using the Visual Studio 2013 wizard, leaving everything as default, which should eliminate any potential hard xrefs that existing projects might have. Even then, I still face the same problem. Each time a code analysis is performed, Studio tries to check this special project and gives a hard refusal.

It's weird that Code Analysis runs on TFS Build Agent without incident. This makes me think the problem is with Studio and depends on the version installed locally. However, I've tried this with VS2013 RTM, 2013 update 5 and VS2015 update 3 and they ALL behave the same. Create a new PHA, follow the instructions for local development using MVC and then run Alt-F11 and the issue will be reproduced.

Can anyone get some code analysis for working with the SharePoint PHA?

+3


source to share





All Articles