Error Performing ASP.NET Precompilation

I'm running VS2012 trying to do a Static Code Analysis.  My code builds with 0 errors and 0 warnings however I receive the following error from Fortify: "Error performing ASP.NET Precompilation.  Would you like to continue? Analysis will not contain complete ASP results until ASP Compilation issues are resolved."  Any ideas or at least a point in the direction to start looking?

 

Thanks

Tags:

  • Verified Answer

    Hey Ryan,

    When building a project in VS, only the .cs and .vb source files are compled.  SCA also requires that the .aspx files be compiled in order to perform the translation.  That's what the ASP.NET precompilation does.  Go ahead and run the scan from the command line so you can see the precompilation errors.

     

    As an example:

    First open the VS command prompt.

    Run the following commands:

     

    Clean - sourceanalyzer -b "Build ID" -clean

     

    Translate/Build - sourceanalyzer -b "Build ID" -verbose -debug -logfile trans.log devenv Sample.sln /Rebuild Debug

     

    You'll be able to see the aspnet_compiler errors with the last command.  Once you get the errors from the compiler, you can google the errors to find out how to fix them.  (the aspnet_compiler is a Microsoft product and should have plenty of information out there)

     

    Hope this helps,

    Alec

  • Thanks Alec. This got me pointed in the right direction. Greatly appreciated
  • Even I am having the same issue, I have tried the commands in command prompt but no use. Can anyone help me on this error.

    C: \ User|\xx\xx\xx sourceanalyzer -b "Build ID" -verbose -debug -logfile trans.lo devenv xyz.sln /Rebuild Debug

    Fortify Static Code Analyzer 6.31.0012

    'devenv' is not recognized as an internal or external command,

    operable program or batch file.

    compiler execution failed (exit code: 1).

    this is the error I am getting in command prompt.

     

     

    Thanks in advance 

     

  • That error message indicates (as it states) that devenv is missing from the machine or the path.  Sounds as though Visual Studio is not installed on the machine.  Could that be the case?

  • Please directly goto the devenv.exe directry and execute it will show the actual error .

    note : I have recived this error 'devenv' is not recognized as an internal or external command

    step 1: first find the where Devenv.exe is there might be below path 

    C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe

    step2 : open the VS command propt goto this path 

    step 3 : execute below command after chnaging the log path and solution folder path and name .

    the command should be like below 

    sourceanalyzer -b "Build ID" -verbose -debug -logfile C:\Project\trans.log devenv C:\Project\IWMCAC\SourceCode_TFS\IWM-CAC_Main2017\2017\IWMCAC.sln /Rebuild Debug

    let me know if it did not help !!!