Web App Logs To File With AppendAllText And It Has Error?
Nov 10, 2010
I logs error from Global.Application_Error method.File.AppendAllText method is used to write message to file with thread safe way using Monitor.However, I keep having the following error "The process cannot access the file 'D:ProjectsFPSPPSLog201011.txt' because it is being used by another process."The file was just created by ASP.NET. When next request writes message to the same file, it cause the issue.f I test after while like 5 min, it doesn' t have problem. But, if I test again after 1 second, the file is locked.
so if a method in the BLL returns say, a list of keyvaluepairs but the DAL has an error, the BLL logs the error but then it needs to tell the UI that there was an error. in this case, how should it be done? What is the best practice?should we have an out parameter for the BLL method so it returns an enum of success/dataretrievalfailure etc.or something else?
I'm looking for a quick way to log some data - I seem to remember a way to write to the access log, similar to System.Out.Println() but I can't seem to remember how to do it.I can't attach a debugger, nor can I add additional information to the web app via Response.Write().Is there a simple way - a single statement with no configuration changes would be ideal - to write to either the error or access logs?
This works fine - I have now added to the page a LoginStatus as when they arrive they are loggen in. The problem is when the user clicks the Logg off link I get the error on the page below -
Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
[Code]....
Is this because the page load is trying to get the logged on user ID
but they have just logged out?
How can I allow the User to logg out without getting the error?
Looking through my web logs, I see a lot of entries that don't interest me. Some of them are commonly used images, css files, and scripts, which I can easily exclude by un-checking the 'log visits' check box in IIS for the folder properties.
I would also like to exclude log entries for certain common requests which are not in their own folders. Mostly, 'favicon.ico'. 'scriptresource.axd', and 'webresource.axd'. These (especially scriptresource.axd) make up almost a third of a typical log file on my site.
I am trying to sort out a problem where some relative urls are not resolving properly in an ASP.NET website. I want to see the HTTP logs to determine which URLs are being requested from the web server. I am using the ASP.NET Development Server, not IIS.So are there logs produced by the ASP.NET Development Server where I can check which files are being requested?Windows 7, 64bitVS2008 ASP.NET 3.5 SP1
I would simply like to append an additional value which is generated at runtime in a page to my IIS log entry for the current request (or as an alternative, overwrite one of the standard fields with my custom value). I can't find an example of writing a custom log handler in C# (I'm not proficient in ะก++)
I bind my data to say GridView or Datagrid or Repeater and give user the ability to remove columns and save his preference and to show the saved preference when he logs back again. (In nutshell customizable Grid.) How to go about it?
I need to write an application that retrieves entries in the MMC event logs (application, system and security events) and would like to do so in ASP if possible. This is an internal application. Someone told me to use PowerShell.
Is it possible to do this in ASP (and use PowerShell) or do I need to use some other tools? I would like to retrieve events into a DataGrid etc.
i'm using ASP.NET membership for a silverlight application that makes use of Wcf Ria Services.
my problem is that i don't want multiple logins on the same account and i need to logout the user when he logs in on another machine. (I don't want the account to be used by many people at the same time, and the last who logs in must kick out everyone else)
I want to log out the user when he (or someone else) logs in from a diferent computer using the same user name.
Basicaly i want to prevent multiple individuals from staying loged in under a single user name by signing out the previous users. Any ideeas about how i can acomplish that ?
I was wondering when a user logs in using the login control for ASP.NET, how do we choose where the user goes after? Do we configure this in the web.config file?
I am trying to run a WCF Data Service using the ASP.Net Dev server (aka Cassini). When I hit F5 I get the following message in my browser:
Request Error The server encountered an error processing the request. See server logs for more details. However, I don't know where Cassini puts its server logs. Does anyone out there know?
We have take over a classic asp site. Everything works fine, but we are making improvements to some reports and adding new reports, so we are doing this in .NET, with that said, after reviewing the secuirty code, there are 2 sessions that are set and used thru-out the site as part of some of the individual page queries.
I know that the sessions are being populated, because the reports that use those values return records.. now with a new report we are working on, i need to pass those values into my query. But when i try using the session names the page is coming up saying the following:Object reference not set to an instance of an object.
Is there anyway to add something to my page code to see what sessions are actually being created and their values.. maybe im using the wrong variable names.. but the security code is pretty straight forward.. at login, if successful, 2 values are returned and stored in 2 sessions.. i need to use those with my new page.. so trying to figure out why the existing pages work fine with that and my new page does not..
Basically, i'd like to write to the screen the session variables that are being created on the login page.
However, when I ran this, I got the following error:
Could not create Windows user token from the credentials specified in the config file. Error from the operating system 'Logon failure: unknown user name or bad password.
I looked at this post
[URL]
It seemed to suggest I would need to create a new account on the remote server. Is there a way I can just use an existing domain account?
I've been trying to work out this error for a while now and i still dont understand it because i have been following a tutorial online step-by-step but i recieve this error when i log in ?
What i am trying to acheive is when the user logs in then they are able to view their 'profile' such as their name, address etc. The login is validated against a table in a database, ...this is the error i am recieving:
Description: An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
I have an web application which requires login. When users finish their activities they simply logout. What I need is to clear browser history when user click logout button. This should disable BACK button in browser.
I have a website on visual studio 2008 on my local machine. When I run through the debugger I get the following error, however when I browse the same website through the IIS manager (running IIS7.5), I can browse it. What do I need to fix to run it through debugger? The website is set as an application.
Error:
Configuration Error
Description:
An error occurred during the processing of a configuration file required to service this request. review the specific error details below and modify your configuration file appropriately.
I have created an application which runs fine in VS2010.Now i am trying to host that application using inetmgr.When i try to browse the page from inetmgr content view then i get the "Parser Error Message: Could not load file or assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified".If i browse the page from VS i am able to do it.I am not able to host the app. may be the reason is the above stated error.