Workaround for the "CMS" virtual directory problem with VS.NET 2005 (Update: 02.06.2006)

With VS.NET 2005 the VS.NET product team decided to change the behaviour of VS.NET for web applications. Up to VS.NET 2003 only virtual directories and files explicitly added to the projects were taken into consideration for the compilation.

With VS.NET 2005 all virtual directories and files are taken into consideration for compilation.

As the “CMS” virtual directory required by MCMS contains lots of ASCX and ASPX files VS.NET tries to compile these files as well – which leads to warnings.

Spencer already discussed a possible solution for this by using Webapplication projects – currently in beta – which allow to use the project model from VS.NET 2003 in VS.NET 2005.

A couple of days ago Andree H. pointed me to a much more elegant solution: VS.NET 2005 ignores all directories and files which are marked as hidden in the file system. So what is required to do is to set the hidden attribute for all physical directories inside the IIS_CMS directory.

After setting this hidden property VS.NET will compile much quicker and the warnings will not show up. In addition this method avoids using unsupported methods like using the web application projects.

Update: when hiding the directories you need to ensure that the content inside the directories is not hidden! So please choose the “Apply changes to this folder only” option in the confirmation dialog!

13 Comments


  1. Its look like when other products made swift trasaction towards VS 2005 the CMS 2002 is just one painfull product to do much in this regard. Why not Microsoft simply let SPS v3 do the cleanup for this un sucessfull product

    Reply

  2. The problem here is VS.NET – not MCMS.

    The behaviour of VS.NET changed in a way that it is no longer possible to exclude specific virtual directories easily.

    As you can see in Spencers article the VS.NET team recognized the limitations of the current implementation of VS.NET 2005 and are working on a solution for this.

    Reply

  3. Just wanted to add a note that you must not cascade the hidden attribute down the directory tree as this causes 404 errors when MCMS tries to access the files contained within.

    Reply

  4. This ‘workaround’ appears to break the Publish Website facility. Great.

    Reply

  5. Hi Alastair, seems you did not only apply this to the directories but also to all content inside these directories.

    You should NOT apply this to the subdirectories.

    Reply

  6. Now after MCMS 2002 SP2 has been released I would like to point you again to an article series I have…

    Reply

  7. Works great for our current project w/o switching back and forth on IIS. Thanks!

    Reply

  8. This does NOT work for me. I have set IIS_CMS to hidden but still the project builds with errors from the CMS folder. Here is the error:

    Error ‘Microsoft.ContentManagement.SharePoint.Dialogs.DialogBase’ does not contain a definition for ‘IDS_CSS_BACKGROUND1’ c:Program FilesMicrosoft Content Management ServerServerIIS_CMSWssIntegrationControlsDialogTitle.ascx 5

    Reply

  9. I have to also set sub directory WssIntegration to hidden.

    Reply

  10. Hi Philip, this is as expected.

    You need to set the CONTENT of IIS_CMS to hidden – not IIS_CMS itself.

    Reply

  11. Thanks Stefan,   I misread your post.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.