Unable to add to the Web site. Unable to add file. Access is denied.

While taking over a C# Web Application that had been migrated to work with Visual Studio 2008 (originally developed and migrated from Visual Studio .NET 2003), I occasionally ran into issues while trying to publish the web application to the production server (or any server for that matter). In the output log, there were multiple error messages, all stating:

Unable to add ‘XXX.aspx’ to the Web site. Unable to add file ‘XXX.aspx’. Access is denied.

Each XXX.aspx would be a different files. What I learned after browsing and searching Google is to make sure the files on the production (or target) server are not marked as Read Only. The solution was to:

  1. Go to the Publish directory
  2. Highlight all files and folders
  3. Right click and select Properties
  4. Make sure the Read-only attribute checkbox is unchecked (white and not gray or checked)

References:
http://forums.asp.net/p/1074678/3431238.aspx#3431238

Share and Enjoy:
  • Digg
  • DotNetKicks
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Live
  • MySpace
  • Netvibes
  • Reddit
  • StumbleUpon
You can leave a response, or trackback from your own site.

Leave a Reply