p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: ASP.NET Website Programming Problem-Design-Solution (http://p2p.wrox.com/forumdisplay.php?f=23)
-   -   unexpected error has occurred (http://p2p.wrox.com/showthread.php?t=588)

tworkman June 15th, 2003 11:41 PM

unexpected error has occurred
 
I had ThePhileVB running on a Windows 2000 machine but on this Windows XP machine I keep getting the following error. Anybody else seen this?


Error Message:
Access to the path "C:\wrox\ThePhileVB\Config\Polls.Config" is denied.

Error Stack:
System.UnauthorizedAccessException: Access to the path "C:\wrox\ThePhileVB\Config\Polls.Config" is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String str)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean bFromProxy)
   at System.IO.FileStream..ctor(String path, FileMode mode)
   at Wrox.WebModules.Polls.Configuration.ModuleConfig.G etSettings() in C:\wrox\ThePhileVB\WebModules\Polls\Polls.Configur ation\ModuleConfig.vb:line 35
   at Wrox.WebModules.Polls.Business.Question.GetCurrent Id() in C:\wrox\ThePhileVB\WebModules\Polls\Polls.Business \Question.vb:line 224
   at Wrox.WebModules.Polls.Web.Controls.User.Poll.DataB ind() in C:\wrox\ThePhileVB\WebModules\Polls\Poll.ascx.vb:l ine 260
   at Wrox.WebModules.Polls.Web.Controls.User.Poll.Page_ Load(Object sender, EventArgs e) in C:\wrox\ThePhileVB\WebModules\Polls\Poll.ascx.vb:l ine 62
   at System.Web.UI.Control.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain()

allenracho June 16th, 2003 09:58 AM

Hi tworkman - It's possible it could be something as simple as directory and/or file permissions? For example, if you were tweaking something and accidentally made either the directory containing Polls.Config or the file itself readable only by Administrator...

Allen

john_rt June 18th, 2003 10:45 AM

Hi,

I get the exact same problem too [V]
It wasn't something I tweaked as I got this error the very first time I tried to run (after installation).

I'm also on an XP Pro machine,
any help would be much appreciated.
Thanks

John

tworkman June 18th, 2003 08:20 PM

We are in the same boat John. I have tried all combinations of web sharing and permissions and even removed the Polls module altogether. The error then became a Newsmanager error. I'm sure the fix is something simple but I haven't found it. If anybody has any suggestions, let John and I know.

Thanks

allenracho June 18th, 2003 10:51 PM

Hi tworkman - I was just about to suggest what you did, removing a module at a time and seeing if the error "propagates," exposing some commonality. If you haven't already, you could try to raise the privilege level at which ASP.NET operates on your machine. This actually solved my initial problems, which were similar to yours (something about application error, security violations and somesuch), but not the exact same "access denied" error.

I don't want to bore you with details if you've tried this already; if you haven't, just give a shout back to this board, and I'll reply. Hang on... there might even be another post here already addressing this.

Allen

mencher cat, mencher cat. boo. cattydear. what a lovely!

clayv June 19th, 2003 06:29 PM

First a caveat:
I use C# so this is untested with VB.NET

I also had this working under .NET 1.0 and it suddenly stopped after upgrading to .NET 1.1 and VS 2003. After trying lots of different permissions on my box (the suggested fix when the exception is thrown is to alter the permissions using the Security tab for the file - which is unavailable on a XP box running in a workgroup), I took a look at the FileStream class and noticed that the default access is Read/Write, which you would want to fail for an anonymous web user..

So the fix is to change your FileStream constuctors in the ModuleConfig.cs files to the following (note C# syntax):

FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read);

Hope that fixes it for you too!

Clay Ver Valen


tworkman June 19th, 2003 11:03 PM

Excellent. Your fix did it Clay. For anybody else that comes along with this problem, VB syntax is the same as C# syntax...

Thanks for posting,
Tim

krista August 2nd, 2003 08:27 PM

I'm getting a similar problem. I tried the Filewriter fix & that didn't seem to work. I'm also running XP Pro & this is my first install. I've done everything in the setup html document & was getting the security error mentioned in another post. I then went into my IIS & unchecked my Annonymous access under Directory Security as developerz suggested. Now I'm getting the error below. Can anyone help?

I'm thinking that this may have something to do with the temp folder being read only. Unfortunately, the D:\WINNT\Microsoft.NET\ folders on my computer fall into that weird XP problem where you can't change their attributes (ref. http://support.microsoft.com/default...b;en-us;326549). I've tried the "attrib -r" fix, but that doesn't seem to help, so is there a way to redirect the temp path to another folder that's not read only? What file would I change?

Thank you for your help.

======================================
An unexpected error has occurred on this page. The system administrators have been notified. Please feel free to contact us with the information surrounding this error.

The error occurred in: http://localhost/thephileVB/Default.aspx
Error Message: Unable to generate a temporary class (result=1).

error CS0009: Metadata file 'D:\WINNT\Microsoft.NET\Framework\v1.0.3705\Tempor ary ASP.NET Files\thephilevb\138ff8aa\5c91653a\assembly\dl\061 ed16e\6139f8cb_5059c301\Wrox.WebModules.Polls.Conf iguration.DLL' could not be opened -- 'Access is denied. '
--------------------------------------------------------------------------------
Stack Trace:
System.InvalidOperationException: Unable to generate a temporary class (result=1). error CS0009: Metadata file 'D:\WINNT\Microsoft.NET\Framework\v1.0.3705\Tempor ary ASP.NET Files\thephilevb\138ff8aa\5c91653a\assembly\dl\061 ed16e\6139f8cb_5059c301\Wrox.WebModules.Polls.Conf iguration.DLL' could not be opened -- 'Access is denied. ' at System.Xml.Serialization.Compiler.Compile() at System.Xml.Serialization.TempAssembly..ctor(XmlMap ping[] xmlMappings) at System.Xml.Serialization.XmlSerializer..ctor(Type type) at Wrox.WebModules.Polls.Configuration.ModuleConfig.G etSettings() in D:\wrox\ThePhile\Modules\Polls2\Polls.Configuratio n\Configuration.cs:line 24 at Wrox.WebModules.Polls.Business.Question.GetCurrent ID() in D:\wrox\ThePhile\Modules\Polls2\Polls.Business\Que stion.cs:line 128 at Wrox.WebModules.Polls.Web.Controls.User.Poll.DataB ind() in D:\wrox\ThePhile\Modules\Polls2\Poll.ascx.cs:line 123 at Wrox.WebModules.Polls.Web.Controls.User.Poll.Page_ Load(Object sender, EventArgs e) in D:\wrox\ThePhile\Modules\Polls2\Poll.ascx.cs:line 114 at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain()

krista August 3rd, 2003 11:00 PM

Actually, nevermind. This problem magically solved itself once I updated the .Net Framework with whatever the latest update was.


AHaeusler August 29th, 2003 01:35 PM

Hi all together!

I had the same problems like krista and tworkman, but updating my ASP .NET Framework to version 1.1 and the post of clayv fixed it. Thanks a lot; I think I've tried about four whole days with changing my IIS settings and the ASP .NET Framework settings.



All times are GMT -4. The time now is 04:45 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.