Locked Why does Code analysis differ between Cassini and IIS Express?

  • Wednesday, August 22, 2012 1:44 PM
     
     

    We're moving to use IIS Express instead of Cassini and I noticed that Code Analysis isn't returning the same results. On one site we have where we started using code analysis late in the game the results are 423 warnings with Cassini VS. 6 warnings With IIS Express.

    Interestingly, on a default VB ASP.NET Web Site without any modifications, the results are 49 warnings with Cassini VS. 0 warnings With IIS Express.

    Can someone please explain this.

    ISSUE REPRODUCTION:

    1. Open Visual Studio 2010
    2. Create a new "VB - ASP.NET Web Site" (not a WebApp)
    3. Run code analysis for website (File Menu -> Analyze -> Run Code Analysis on Web Site)note that output shows: Running Code Analysis on Web Site C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\FxCopCmd.exe /o:"\[OurServer]\sys\user[MyUserName]\My Documents\Visual Studio 2010\Projects\AllLocalTest\AllLocalTest{38557EBD-D900-482B-B048-B527347036D1}\CodeAnalysisLog.xml" /asp /searchgac /ignoreinvalidtargets /forceoutput /successfile /ignoregeneratedcode /outputCulture:"1033" /r:"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\Rules" /rs:"=MinimumRecommendedRules.ruleset" /rsd:"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop..\Rule Sets" /f:"C:\Users[MyUserName]\AppData\Local\Temp\tmp94D6.tmp.cadir\bin\App_global.asax.dll" /f:"C:\Users[MyUserName]\AppData\Local\Temp\tmp94D6.tmp.cadir\bin\App_Web_303a5ti3.dll" /f:"C:\Users[MyUserName]\AppData\Local\Temp\tmp94D6.tmp.cadir\bin\App_Web_bwgrez5a.dll" /f:"C:\Users[MyUserName]\AppData\Local\Temp\tmp94D6.tmp.cadir\bin\App_Web_ruojygvq.dll")
    4. Results have 0 errors and 49 warnings
    5. change site to use IIS Express (right-click in solution explorer on path and select “Use IIS Express…” )accept popups and wait for solution explorer to change path to “http://localhost...”
    6. Run code analysis for website (File Menu -> Analyze -> Run Code Analysis on Web Site)note that output shows nothing related to FxCop
    7. Results have 0 errors and 0 warnings

All Replies

  • Friday, August 24, 2012 6:36 AM
    Moderator
     
     

    Hi daustin_dev,

    I try to check it in my PC, it seems that it worked normally, it has the same warnings.

    Just to make this issue clearly, did you install the VS2010 SP1? VS 2010 SP1 supports both IIS Express and Cassini (VS 2010 supports only Cassini). Maybe you could try to check it in other PC.

    Best Regards,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us

  • Tuesday, August 28, 2012 12:37 PM
     
     

    Thanks for the reply, Jack.

    We have tried it on multiple machines with the same results. It’s only the same if we create a “Web Project”. The issue exists when a “WebSite” is created. Which did you try?

    This is what we’re running

    Microsoft Visual Studio 2010

    Version 10.0.40219.1 SP1Rel

    Microsoft .NET Framework

    Version 4.0.30319 SP1Rel

    Installed Version: Ultimate

    Microsoft Office Developer Tools   XXXXX-XXX-XXXXXXX-XXXXX

    Microsoft Office Developer Tools

    Microsoft Visual Basic 2010   XXXXX-XXX-XXXXXXX-XXXXX

    Microsoft Visual Basic 2010

    Microsoft Visual C# 2010   XXXXX-XXX-XXXXXXX-XXXXX

    Microsoft Visual C# 2010

    Microsoft Visual C++ 2010   XXXXX-XXX-XXXXXXX-XXXXX

    Microsoft Visual C++ 2010

    Microsoft Visual F# 2010   XXXXX-XXX-XXXXXXX-XXXXX

    Microsoft Visual F# 2010

    Microsoft Visual Studio 2010 Architecture and Modeling Tools   XXXXX-XXX-XXXXXXX-XXXXX

    Microsoft Visual Studio 2010 Architecture and Modeling Tools

       

    UML® and Unified Modeling Language™ are trademarks or registered trademarks of the Object Management Group, Inc. in the United States and other countries.

    Microsoft Visual Studio 2010 Code Analysis Spell Checker   XXXXX-XXX-XXXXXXX-XXXXX

    Microsoft Visual Studio 2010 Code Analysis Spell Checker

    Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.

    The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.

    Microsoft Visual Studio 2010 Team Explorer   XXXXX-XXX-XXXXXXX-XXXXX

    Microsoft Visual Studio 2010 Team Explorer

    Microsoft Visual Web Developer 2010   XXXXX-XXX-XXXXXXX-XXXXX

    Microsoft Visual Web Developer 2010

    Coded UI Test Editor   1.0

    Enable editing of a UITest (*.uitest) file

    Crystal Reports Templates for Microsoft Visual Studio 2010  

    Crystal Reports Templates for Microsoft Visual Studio 2010

    Hotfix for Microsoft Visual Studio 2010 Ultimate - ENU (KB2522890)   KB2522890

    This hotfix is for Microsoft Visual Studio 2010 Ultimate - ENU.

    If you later install a more recent service pack, this hotfix will be uninstalled automatically.

    For more information, visit http://support.microsoft.com/kb/2522890.

    Hotfix for Microsoft Visual Studio 2010 Ultimate - ENU (KB2529927)   KB2529927

    This hotfix is for Microsoft Visual Studio 2010 Ultimate - ENU.

    If you later install a more recent service pack, this hotfix will be uninstalled automatically.

    For more information, visit http://support.microsoft.com/kb/2529927.

    Hotfix for Microsoft Visual Studio 2010 Ultimate - ENU (KB2548139)   KB2548139

    This hotfix is for Microsoft Visual Studio 2010 Ultimate - ENU.

    If you later install a more recent service pack, this hotfix will be uninstalled automatically.

    For more information, visit http://support.microsoft.com/kb/2548139.

    Hotfix for Microsoft Visual Studio 2010 Ultimate - ENU (KB2549864)   KB2549864

    This hotfix is for Microsoft Visual Studio 2010 Ultimate - ENU.

    If you later install a more recent service pack, this hotfix will be uninstalled automatically.

    For more information, visit http://support.microsoft.com/kb/2549864.

    Hotfix for Microsoft Visual Studio 2010 Ultimate - ENU (KB2565057)   KB2565057

    This hotfix is for Microsoft Visual Studio 2010 Ultimate - ENU.

    If you later install a more recent service pack, this hotfix will be uninstalled automatically.

    For more information, visit http://support.microsoft.com/kb/2565057.

    Hotfix for Microsoft Visual Studio 2010 Ultimate - ENU (KB2635973)   KB2635973

    This hotfix is for Microsoft Visual Studio 2010 Ultimate - ENU.

    If you later install a more recent service pack, this hotfix will be uninstalled automatically.

    For more information, visit http://support.microsoft.com/kb/2635973.

    Microsoft Visual Studio 2010 SharePoint Developer Tools   10.0.40219

    Microsoft Visual Studio 2010 SharePoint Developer Tools

    Microsoft Visual Studio 2010 Ultimate - ENU Service Pack 1 (KB983509)   KB983509

    This service pack is for Microsoft Visual Studio 2010 Ultimate - ENU.

    If you later install a more recent service pack, this service pack will be uninstalled automatically.

    For more information, visit http://support.microsoft.com/kb/983509.

    Microsoft Visual Studio 2010 Visualization and Modeling Feature Pack   2.0

    Extends the visualization and modeling tools in Visual Studio Ultimate:  generate dependency graphs for Web sites and native projects, generate code from UML models, build UML models from Visual C# code, import UML from other tools, create and follow bidirectional links between work items and UML models, and add custom commands and validation code to layer diagrams.

    RedGate.Reflector.VsPackage   7.5.3.8

    Visual Studio extension that integrates .NET Reflector into Visual Studio to allow you to seamlessly debug into third-party code and assemblies, even if you don't have the source code for them.

    Visit www.reflector.net for more information.

    Copyright (c) 2009-2012 Red Gate Software Inc.

    Security Update for Microsoft Visual Studio 2010 Ultimate - ENU (KB2645410)   KB2645410

    This security update is for Microsoft Visual Studio 2010 Ultimate - ENU.

    If you later install a more recent service pack, this security update will be uninstalled automatically.

    For more information, visit http://support.microsoft.com/kb/2645410.

  • Wednesday, August 29, 2012 3:24 AM
    Moderator
     
     

    Hi daustin_dev,

    I check it with a web project, would you mind sharing us your project? I try to check it in my PC. Of course, if you have the VS2012, maybe you could try to check it in the latest version.

    Please attach your Visual Studio project, you can upload it to the sky driver, and then share the download link in your post.

    Best Regards,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us

  • Wednesday, August 29, 2012 3:19 PM
     
     

    I’ve created a zip file of the site for you. Please see the ReadMe.txt file in the root.

    The site is nothing but a default “ASP.NET web site” via “Visual Studio Ultimate -> File -> New Web Site…” (Shift + Alt + N)

    http://sdrv.ms/OqV6Wi

  • Thursday, August 30, 2012 3:14 AM
    Moderator
     
     Answered

    Hi daustin_dev,

    I’m afraid that I misunderstand this issue, actually I try to check it with the web app, not the web site, in addition, I use the “Local IIS Web server”, not the IIS Express, and I think you install it like the following screen shot.

    I try to repro it with a web site, I get the same issue, it doesn’t work, I’m not very familiar with the IIS express, but when we run the Code analysis tool for a web site, we could get the “Running Code Analysis on Web Site” in the Output window, but if we use the IIS Express, we couldn’t get it in the window. So I’m afraid that it doesn’t support it.

    Code analysis for managed code analyzes managed assemblies and reports information about the assemblies, I doubt that if we use the IIS Express, it couldn’t start the Code analysis.

    Maybe you could submit a feature request: http://visualstudio.uservoice.com/forums/121579-visual-studio. The Visual Studio product team is listening to user voice there. You can send your idea there and people can vote. Thanks for your understanding.

    Best Regards,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us