473,597 Members | 2,499 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Server error on first try, but succeeds in subsequent tries (accessing files)?


Fairly new to ASP.NET 1.1. Getting the error below when running
application on a web server outside of my control, but only the first
time I run it:

1. After a long period of inactivity (or updating the code-behind dll)
accessing any aspx page in the application causes the application
to run for the first time. Some of the initialization involves
reading and writing some text and xml files using simple streamreader
and streamwriter objects.
I get a Windows Logon dialog(?) After clicking Cancel, I get the
error below.

2. After getting the initial error, all I have to do is press F5
(refresh) in IE and everything is fine. No errors or login dialogs
when accessing the same page or other pages.

Though the server is outside of my control (only ftp access), surely
I must be able to change a setting in my program that will make it
work without displaying the initial Windows Logon dialog, seeing
that everything works afterwards?

I have included the web.config file as well. Only changes I have made
are (as far as I remember):

<customErrors mode="Off" />
<authenticati on mode="Windows" />
<identity impersonate="tr ue" />

Any ideas?

TIA,

Joergen Bech
-------------------------------------------------
--- error message ---------------------
-------------------------------------------------

Server Error in '/' Application.
--------------------------------------------------------------------------------

Access to the path "d:\web\mydomai n.dk\www\webapp lication.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.Unauthor izedAccessExcep tion: Access to the
path "d:\web\mydomai n.dk\www\webapp lication.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}\ASPNE T 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="tr ue"/>, the identity will be
the anonymous user (typically IUSR_MACHINENAM E) 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:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.

Stack Trace:
[UnauthorizedAcc essException: Access to the path
"d:\web\mydomai n.dk\www\webapp lication.xml" is denied.]
System.IO.__Err or.WinIOError(I nt32 errorCode, String str) +393
System.IO.FileS tream..ctor(Str ing path, FileMode mode, FileAccess
access, FileShare share, Int32 bufferSize, Boolean useAsync, String
msgPath, Boolean bFromProxy) +888
System.IO.FileS tream..ctor(Str ing path, FileMode mode, FileAccess
access, FileShare share, Int32 bufferSize) +44
System.IO.Strea mWriter.CreateF ile(String path, Boolean append) +55
System.IO.Strea mWriter..ctor(S tring path, Boolean append, Encoding
encoding, Int32 bufferSize) +49
System.IO.Strea mWriter..ctor(S tring path) +60
mydomain.modFil eFunctions.Writ eTextFile(Strin g strData, String
FullPath, String ErrInfo)
mydomain.CMSIte m.Save(String FilePathName, Boolean UseCompression,
Boolean IncludeProperti es, Boolean IncludeMembers, Boolean IsGraph)
mydomain.modVBT estData.SaveApp licationData()
mydomain.modVBT estData.CreateT estData()
mydomain.Global .Application_St art(Object sender, EventArgs e)
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.432 2.510;
ASP.NET Version:1.1.432 2.510

-------------------------------------------------
--- web.config ---------------------
-------------------------------------------------

<?xml version="1.0" encoding="utf-8" ?>
<configuratio n>

<system.web>

<httpHandlers >
<add verb="GET"
path="FtbWebRes ource.axd"
type="FreeTextB oxControls.Asse mblyResourceHan dler,
FreeTextBox" />
</httpHandlers>

<!-- DYNAMIC DEBUG COMPILATION
Set compilation debug="true" to insert debugging symbols
(.pdb information)
into the compiled page. Because this creates a larger file
that executes
more slowly, you should set this value to true only when
debugging and to
false at all other times. For more information, refer to the
documentation about
debugging ASP.NET files.
-->
<compilation defaultLanguage ="vb" debug="true" />

<!-- CUSTOM ERROR MESSAGES
Set customErrors mode="On" or "RemoteOnly " to enable custom
error messages, "Off" to disable.
Add <error> tags for each of the errors you want to handle.

"On" Always display custom (friendly) messages.
"Off" Always display detailed ASP.NET error information.
"RemoteOnly " Display custom (friendly) messages only to
users not running
on the local Web server. This setting is recommended for
security purposes, so
that you do not display application detail information to
remote clients.
-->
<customErrors mode="Off" />

<!-- AUTHENTICATION
This section sets the authentication policies of the
application. Possible modes are "Windows",
"Forms", "Passport" and "None"

"None" No authentication is performed.
"Windows" IIS performs authentication (Basic, Digest, or
Integrated Windows) according to
its settings for the application. Anonymous access must be
disabled in IIS.
"Forms" You provide a custom form (Web page) for users to
enter their credentials, and then
you authenticate them in your application. A user
credential token is stored in a cookie.
"Passport" Authentication is performed via a centralized
authentication service provided
by Microsoft that offers a single logon and core profile
services for member sites.
-->
<authenticati on mode="Windows" />
<identity impersonate="tr ue" />

<!-- AUTHORIZATION
This section sets the authorization policies of the
application. You can allow or deny access
to application resources by user or role. Wildcards: "*"
mean everyone, "?" means anonymous
(unauthenticate d) users.
-->
<authorizatio n>
<allow users="*" /> <!-- Allow all users -->

<!-- <allow users="[comma separated list of users]"
roles="[comma separated list of roles]"/>
<deny users="[comma separated list of users]"
roles="[comma separated list of roles]"/>
-->
<!-- <allow users="*" /> -->
</authorization>

<!-- APPLICATION-LEVEL TRACE LOGGING
Application-level tracing enables trace log output for every
page within an application.
Set trace enabled="true" to enable application trace
logging. If pageOutput="tru e", the
trace information will be displayed at the bottom of each
page. Otherwise, you can view the
application trace log by browsing the "trace.axd" page from
your web application
root.
-->
<trace enabled="false" requestLimit="1 0" pageOutput="fal se"
traceMode="Sort ByTime" localOnly="true " />
<!-- SESSION STATE SETTINGS
By default ASP.NET uses cookies to identify which requests
belong to a particular session.
If cookies are not available, a session can be tracked by
adding a session identifier to the URL.
To disable cookies, set sessionState cookieless="tru e".
-->
<sessionState
mode="InProc"
stateConnection String="tcpip=1 27.0.0.1:42424"
sqlConnectionSt ring="data
source=127.0.0. 1;Trusted_Conne ction=yes"
cookieless="fal se"
timeout="20"
/>

<!-- GLOBALIZATION
This section sets the globalization settings of the
application.
-->
<globalizatio n requestEncoding ="utf-8" responseEncodin g="utf-8" />

</system.web>

</configuration>


Nov 19 '05 #1
0 2254

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
409
by: Tlink | last post by:
I am using server.transfer from within vb.net, which is called from asp.net I find that I can move to correct page the first time the server.transfer is executed but all subsequent attempts cause a error message. The following is my logic code: If RedirectPage.StartsWith("~") Then RedirectPage = Replace(RedirectPage, "~", "") Dim bs As New Uri(CurrentUrl)
6
8450
by: Rolf Schroedter | last post by:
(Sorry for cross-posting). I need to access large files > 2GByte (Linux, WinXP/NTFS) using the standard C-library calls. Till today I thought I know how to do it, namely for Win32: Use open(), read(), _itelli64(), _lseeki64() with type __int64 Linux/Cygwin: #define _FILE_OFFSET_BITS 64 Use open(), read(), lseek() with type off_t
4
1871
by: Mullin Yu | last post by:
i have a stored procedure at sql server 2k. which will update records and select result from temp table. if i use SqlConnection class, and i do both. but, if i use OleDbConnection class, i can have only records updated, but no result come out. how can i debug, and what's the error? thanks!
4
3498
by: John Boy | last post by:
Hi, Can anyone help. This is really doing my nut in. 3 years ASP exp. and now doing .DOT which is a step in the wrong direction. Basically I am left with the code of a guy who has left. When I click a button on a pop-up window the javascript for that button click does a 'button.form.submit'. On the Server side there is a Button click event for this button, but for some reason it no longer fires. It worked fine before and everything...
0
3583
by: John Bown | last post by:
This query is similar to some others on this discussion group, but none of them were resolved! Can anybody help: The issue is related to integrated authentication. First I'll describe a simple scenario not involving ISA server, which works as expected: The web service is hosted on a server in the same domain as my workstation with anonymous access denied, and integrated authentication enabled. If I access the web service using the...
4
5243
by: Greg P | last post by:
I know this is a long post, please bear with me. I have been working on this all weekend to no avail although I have done a good amount of research (see most pertinent links that I've looked at below). Please help me get through this!!! I'm having some serious problems attaching a .mdf file and accessing it. I have a WroxUntied.mdf that I want to attach and then run the website that uses it. This is a .mdf file from wrox books. ...
2
4023
by: Greg Strong | last post by:
I'm experimenting with using Access 2k2 as a front end to Oracle Express. I am creating 10 tables using pass through DDL queries. The PROBLEM is the general format of the VB code WORKS on the 1st 6 tables created, then an error is thrown which I can't find much help on. I've compared the code on the 6th table to the 5th which is successful, and the general format is the same. It seems the more you try, the quicker the problem is...
0
8830
by: Kris Mattheus | last post by:
A little background: I've been using web services successfully for a while now. My web server is a Windows CE 4.2 device and my client is a windows C# application created with Visual Studio 2003. My web server has both NTLM and Basic authentication. By providing the Credentials for my web service call, my application can access the web service without any problems. The problem: I recently created a new application with Visual Studio...
5
6313
by: marshmallowww | last post by:
I have an Access 2000 mde application which uses ADO and pass through queries to communicate with SQL Server 7, 2000 or 2005. Some of my customers, especially those with SQL Server 2005, have had pass-through queries fail due to intermittent connection failures. I can easily restablish a connection for ADO. My problem is with pass-through queries.
0
7893
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8276
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8381
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8040
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
5847
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5436
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3932
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1495
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1243
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.