cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
asanford
Level 4

clear read-only attribute for Web.Config when specified as Content files

I am using ISLE-2011 to setup an asp.net app on windows 2008, including setup a new web site and application in IIS. There appears to be a known issue where the install will fail on 2008 if web.config that is being installed is marked as read-only. I am specifying this file in ISLE indirectly, via the ASP.NET web project's "Content Files".

I tried clicking on this "Content Files" entry in my "destination computer's files" (bottom right pane in ISLE files view), right clicking, select properties, checking the "Override System attributes", and then making sure the "Read Only" checkbox is clear. However, this does not fix the problem.

I verified that adjusting the "Content Files" entry's settings this way seems to have no effect on the files installed by manually changing the actual web.config file's read-only attribute to false, and then successfully installing. At this point, I view the attributes of the the files installed, and all the installed files except web.config are still set to read-only, even though I set the "Override System attributes" box and cleared the "read only" box for the "Content files" entry.

I'd like to continue to use the "Content files" entry, instead of manually linking to files, because it avoids missing files when added, and also manually adding explicit links seems to put the full path to the file - which won't work for me because I'm using tfs build.

How can I get "web.config" to be copied via "Content files" but still be marked as not-read-only, without having to actually set the web.config file to not be read only? I don't want to set the actual file to be not read only because I'm reading the files from TFS via tfs build (msbuild.) I suppose I could create some custom build step somewhere that changes the file attrib somewhere or checks out the file, but that seems hokey.
0 Kudos
(3) Replies
Madusree
Level 7

Hi,

I am currently looking into this Issue.I should have further updates at the earliest.

Thanks,
Madu
0 Kudos
Madusree
Level 7

Hi,

You can change the file attribute from a MS Build Script by using the Exec with the command attribute



This will remove the read-ony attribute from the myFile.ext file in the solution folder.

Thanks,
Madu
0 Kudos
asanford
Level 4

Thanks, Madusree.

I haven't tried an explicit msbuild task for the workaround as you described, but I was able to workaround the problem by defining a pre-build event that runs the "attrib -r" cmd for the web.config.

However, as I mentioned in my original post, it seems this is really a workaround to the "Override System attributes" installshield function not working as a way to clear the read-only flag. Is this a known bug with a fix scheduled?

Thanks a bunch!
0 Kudos