Changing portal settings fails with "Access to the path "...PortalCfg.xml" is denied.

If I try to make any changes to the ASP.NET Portal Starter kit it fails with an access denied error.

This was working when I left last week and is failing today. I don't remember changing anything, but I guess something had to be changed.
I have checked NTFS permissions and the ASPNET account has full control on the parent directory of that XML file and on the file itself. I have also checked in IIS, and the Virtual Directory has "write" allowed.
The funny thing is that the change I am trying to make works! So if I reload the page I see the change.
Here is the full error:
Server Error in '/PortalCSVS' Application.

Access to the path "C:\Program Files\ASP.NET Starter Kits\ASP.NET Portal (CSVS)\PortalCSVS\PortalCfg.xml" is denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.UnauthorizedAccessException: Access to the path "C:\Program Files\ASP.NET Starter Kits\ASP.NET Portal (CSVS)\PortalCSVS\PortalCfg.xml" is denied.
ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
Source Error:

Line 776:
Line 777: // Object is evicted from the Cache here.
Line 778: siteSettings.WriteXml(configFile);
Line 779: }
Line 780: }

Source File: C:\Program Files\ASP.NET Starter Kits\ASP.NET Portal (CSVS)\PortalCSVS\Components\Configuration.cs Line: 778
Stack Trace:

[UnauthorizedAccessException: Access to the path "C:\Program Files\ASP.NET Starter Kits\ASP.NET Portal (CSVS)\PortalCSVS\PortalCfg.xml" is denied.]
System.IO.__Error.WinIOError(Int32 errorCode, String str) +393
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean bFromProxy) +888
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) +45
System.Xml.XmlTextWriter..ctor(String filename, Encoding encoding) +34
System.Data.DataSet.WriteXml(String fileName, XmlWriteMode mode) +48
System.Data.DataSet.WriteXml(String fileName) +7
ASPNET.StarterKit.Portal.Configuration.SaveSiteSettings() in C:\Program Files\ASP.NET Starter Kits\ASP.NET Portal (CSVS)\PortalCSVS\Components\Configuration.cs:778
ASPNET.StarterKit.Portal.Configuration.UpdatePortalInfo(Int32 portalId, String portalName, Boolean alwaysShow) in C:\Program Files\ASP.NET Starter Kits\ASP.NET Portal (CSVS)\PortalCSVS\Components\Configuration.cs:55
ASPNET.StarterKit.Portal.SiteSettings.Apply_Click(Object sender, EventArgs e) in C:\Program Files\ASP.NET Starter Kits\ASP.NET Portal (CSVS)\PortalCSVS\admin\SiteSettings.ascx.cs:54
System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e) +108
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +138
System.Web.UI.Page.ProcessRequestMain() +1277

Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
12/2/2003 2:19:02 AM 91979 articles. 3 followers. Follow

3 Replies

Similar Articles

[PageSpeed] 26

The config file is perhaps locked by your own code. You haven't "released" it.


Hope this might help.

12/2/2003 3:02:36 PM
siteSettings & configFile don't have a "Close" method.

Any other ideas?
12/2/2003 7:04:04 PM
Oh. I had presumed, because of your locked file, that configFile must have been a Writer.
12/3/2003 2:55:47 AM

Similar Artilces:

"access to path"...."is denied"
I have a program that opens a csv file and copies all records to a database.  its working fine in development system but when i deploy this to the live system and if i try to copy a csv file on my machine i am getting an error "access to path"..<tempfile.txt> .."is denied.  I am creating a temporary file on the live server and then changing data and then copying records from the temp file to the live databaseThe problem is that the program cannot access the temp file.  Is there a way to change security access rights of the temp file programmatically so tha...

Get "Mail"/"Get "News" / "Write"/"Post" buttons?
If the "Get Mail" button text changed to "Get News", and "Write" changed to "Post" when TB's in the news-reading mode, it would save me and probably others from constantly forgetting to make the change before proceeding. :-) Or is there an extension to do this which I don't know about? Thanks! Bob Bob P wrote: > If the "Get Mail" button text changed to "Get News", and "Write" > changed to "Post" when TB's in the news-reading mode, it would save me > and probably others...

Error found "Access to the path "C:\Program Files\Microsoft Visual Studio .NET\Crystal Reports\Viewers" is denied. "
Hi guys! i'm trying to solve the error "Err Msg: "Object reference not set to an instance of an object" in ASP.NET app" but when i followed the instructions in the link, this error appeared ""Access to the path "C:\Program Files\Microsoft Visual Studio .NET\Crystal Reports\Viewers" is denied. " What's going on? i already went to the iis to add new virtual directory (CrystalReportWebFormViewer) but different error appeared when i compile and browse my application. pls help ...

Trying to change the Register link to "signup" or "get started"
Can someone please tell me where to change the text for the Register link. I would rather it say "signup" or "Get Started" or something. I have spent a long time looking for a place to change this, but im stumped. Any help is appreciated You can do this by modifying the resource file for the User control.  This is how it is accomplished: Goto the menu:  Admin->Languages. Open:  Local Resources->Admin->Skins->User.ascx.  It will ask you to "You are about to create a custom localized file for this portal. Are you sure you want to overload default localized fil...

"Access Denied...Failed to start monitoring file changes" ERROR!
I have a simple aspx page on my Win 2K server that refuses to run. It gives me the following error: "Access denied to 'C:\web\myaspnetproject\www\clickredirect.aspx'. Failed to start monitoring file changes. " The rest of the error is below. I have read a million threads regarding this error and they all say to add the ASPNET to the entire folder hierarchy of your web project. I have done that. I have given FULL CONTROL to user ASPNET on each directory right up till C:/ which has Everyone with full control. This page accesses a SQL server on another box. But I hav...

Access to the path "F:\Inetpub\wwwroot\PortalVBSDK\PortalCfg.xml" is denied.
I have already added full control rights to and also the iusr_ machinename user.however, i am still having this problem.Is there anything else i can do ? thanks I don't know if this applies to you... but the following link describes a similar problem (and solution) when running IIS under "Network Service". hth

Precedence of "where" ("of", "is", "will")?
Nobody on #perl6 today could answer this one. Is: Str | Int where { $_ } the same as: (Str | Int) where { $_ } or: Str | (Int where { $_ }) ? Followup questions, Mr. President: What kind of operators are "where", "of", "is", and "will"? Is there a reason that S03 doesn't list them? What are their precedence(s)? -- Chip Salzenberg - a.k.a. - <> Open Source is not an excuse to write fun code then leave the actual work to others. Chip Salzenberg writes: &...

.ALLCOL("%COLUMN%", " ", ", ", ", ")
Do you know anyway for me to exclude a subset of columns returned by this function. We have two columns (rec_user and rec_datetime) which are in all of our tables, but when generating triggers I want automatically generate a script which does not include those two columns but does include all other columns in that table. Bruce I should add that I am using PD Bruce "Bruce Lamb" <> wrote in message > Do you know anyway for me to exclude a subset of columns returned by this > function. ...

What is the use of "Get" and "Set" and how it works?
I'm trying to figure out one part of the code which I found for paging. After looking at them and search other articles about this, I still couldn't understand how this "Get" and "Set" works. Can someone provide me a simple explaination how it works and why we need it? Thanks.1 Public Property CurrentPage() As Integer 2 Get 3 Dim o As Object = ViewState("_CurrentPage") 4 5 If o Is Nothing Then 6 Return 0 7 Else 8 Return o 9 End ...

How to automatically send denied users to "access denied" page, instead of a login prompt only then to be sent to "access denied" page
Hello: My security works fine except for one small annoyance.  This is an intranet site only and are using Windows (AD) authentication with Anonymous turned off.  The 'good' users get right in, with no prompts.  This is good.  However, the 'bad' (denied) users get a prompt to enter their credentials only to be denied.  I would like to eliminate the need for them to even try and enter credentials and send them directly to an "access denied" page (no prompts).  It only wastes their time and aggrevates them. Thoughts? Tha...

errorContext description="Access is denied." code="0x80070005" executeSeqNo="0"
I am installing the Hosted Exchange Sample Web Service Client using - Volume 7: Deploying Hosted Exchange 2003, Book 6: Running Hosted Exchange Reference Architecture. At 7.6.7 To initialize the MPFClient configuration Registry key; I get the error message when clicking the "invoke" button: <?xml version="1.0" encoding="utf-8" ?> <string xmlns=""><response><errorContext description="Access is denied." code="0x80070005" executeSeqNo="0" />&...

Is "Bug Changes" multi-select an "and" or an "or"?
Either I'm confused, or there is a defect with the way that advanced searching in the "Bug Changes" box works (perhaps both). I created 2 new Bugs and 2841 is just new. No PCR chagnes of any form. 2842 is new, but with the status changed (I accepted the bug). Then I ran two queries. First I unselected everything, then in the "Bug Changes" box I selected: Only bugs changed in 2d with "[Bug creation]" ...

quotes, quotes, quotes...
I am getting this error and I know what is causing it, but I have no idea how to fix it, any help would be great. The script steps through the /var/log/messages file on a linux server and puts The entries into a mysql database. However when it gets to the 'hlt' line in the messages file it just barfs. The single quotes are freaking it out. I know about quotes but not how to use in this situation. Thanks, Paul Error: May 27 17:53:00 localhost kernel: Checking 'hlt' instruction... OK. <----- doesn't like this in the messages file DBD::mysql::st exec...

I get "Access denied to path...." Exception.
I have Vista SP1. And write FileUpload function. I don't know what to do? I get "Access denied to path...." Exception. My code is alright. My path is alright. Code is nextpublic string GetFileName() { string fileName = "user."+Guid.NewGuid().ToString();return Path.Combine(Request.PhysicalApplicationPath, fileName);   }  protected void BtnUpload_Click(object sender, EventArgs e) {string fileType = "image/pjpeg"; if (PictureFileUpload.PostedFile.ContentLength != 0) {if (PictureFileUpload.PostedFile.ContentType == fileType) { //FileIOP...

Web resources about - Changing portal settings fails with "Access to the path "...PortalCfg.xml" is denied. -

Resources last updated: 11/25/2015 2:23:30 AM