.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

A GUID might be prepended to the filename of the log file

Posted By:      Posted Date: September 20, 2010    Points: 0   Category :ASP.Net


Problem Definition:

I have an asp.net application when i am using microsft enterprise library for logging v4.1.

I found that a guid is added to the name of my file. I did googling and came to know that because of the following reasons it  is happening:

A RollingFileTraceListener instance "owns" the log file it is writing to and locks it for exclusive write access when it writes the first log entry. It keeps the file locked until the instance is disposed. If another RollingFileTraceListener  instance is created that points to the same file, before the first instance is disposed, the second instance cannot open this file for writing and will write to a new file with a GUID prepended to its name.

So my question is how i can overcome this issue?

Please do reply. Thanks in advance.

View Complete Post

More Related Resource Links

Logging Application Block -- A GUID might be prepended to the filename of the log file



Here is my problem definintion.

I am using Microsoft.Practices.EnterpriseLibrary.Logging.dll 4.1 version. It is found that

"A GUID might be prepended to the filename of the log file".

I did some googling and came to know that this is known issue from the following link


So how to resolve this. Is there any cleaner approch that i can use.

Please do reply.

Thanks in advance.

How to show a message box on an invalid filename entered while saving a file using save file dialog

Hi all i have written a code to display a message box if invalid characters are entered while saving the file but my message box is not displaying. Actually i will have a save file dialog option to save a file if the filename starts or consists of the following    \\/:*?<>|"  I would like to display a message box as invalid or illegalcharacters in file My code is as follows    Stream myStream;                          SaveFileDialog saveFileDialog1 = new SaveFileDialog();                            saveFileDialog1.InitialDirectory = @"C:\";                          saveFileDialog1.DefaultExt = "txt";                          saveFileDialog1.Filter = "(*.txt)|*.txt";                          saveFileDialog1.FilterIndex = 2;                          saveFileDialog1.RestoreDirectory = true;                            if (saveFileDialog1.ShowDialog() == DialogR

"The URL '#doc lib#/#filename#' is invalid. It may refer to a nonexistent file or folder, or refe


Hi All,

We have a SharePoint web farm with 3 WFEs. We have MOSS 2007 64bit Enterprise. On one of the WFEs, when we try to upload a document, the user gets the following error:

The URL '#doc lib#/#filename#' is invalid.  It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web. 

It is happening for all document libraries. However, if the user is on the other 2 WFEs, the error does not happen. The WFEs are patched to the same level & we do not know why this error is happening. Can anyone shed light on this issue?

Below is the log from the sharepoint logs before the error happens with the actual error line highlighted:

01/27/2009 12:41:04.75  w3wp.exe (0x11AC)                        0x0A30 Windows SharePoint Services    Database                       8sli Monitorable List item query elapsed time: 2492 milliseconds, Additional data (if available): Query HRESULT: 0 List internal name, flags, and URL: {14A523F8-BF72-4A60-94A0-896D2452A2DE}, flags=0x0000000020c01000, URL="http://www.joneslanglasalle.com/" Query XML: "<Query><Where><And><And><Or><Eq><FieldRef Name="UserLanguage" Nullable="True"/><Value Type="Lookup">en-us</Value>&l

Saving a Xml file to a RANDOM filename


Hello everybody,

I got an application that opens a xml file and writes to it and saves it to another (fixed) file name.

But my question is: Is there a way to save the Xml file to a random number or the input of a textbox?

I am using the XmlTextWriter in a Form app and the language is C#.

file upload - filename?



Having used the fileUpload successfully I got the file to the server required.  I would also like to get this file name inserted into a db but not sure how I refer to this within the  


<asp:ControlParameter ControlID="fileName" Name="fileName" PropertyName=" ? " />

Any ideas or suggestions would be gratefully appreciated

Getting relative filename from directory & file


Hi all;

Is there a method where if I have a directory and a fully qualified filename, I can get a relative filename from the driectory to the file?

And is there a way to do the same thing with an http driectory and filename?

thanks - dave

The future of B.I. - Raw & Uncut

How to add a user DSN for SQL Server Compact Edition Database File (filename.sdf)

I'm very new to database operations, so bear with me.
I have a SQL Server Compact Edition Database File (filename.sdf).
I can connect to this database file (filename.sdf) using MS SQL Server 2008 with server type set to SQL Server Compact Edition. I can select data and do queries.
But in order to connect to the database file from National Instruments LabWindows CVI, I have to create a User DSN under my ODBC Data Source Administrator.
None of the samples represents a *.sdf file.
I clicked on Add and get a window called Create New Data Source.
I am asked to Select a driver for which you want to set up a data source.
I tried the SQL Server option, but that did not seem to work.
The database connectivity test always fails.
Is there a better driver with which to communicate with a sdf file?

File Splitter in .Net

I love to do utility programs in .Net. And this is one of them. As I was playing with JSplit (a free file splitter program), I wondered if I could do it in .Net. The framework supports file operations like reading files in bytes and creating them. It is indeed easy to do file operations in .Net Basics on File operations

Upload Multiple File using JQuery in asp.net

In this article I have explained how to upload multiple files using file upload control. I have used jQuery plugin for uploading multiple files.

I have also explained how to check for file type, file maximum size limit using jQuery & also using server side validation code.

Creating Excel file from C#

I used below coding for create a excel sheet.I got from on web site.
In below coding there is no problem.Its create the excel file.If i run second time,its ask to overwrite the current excel file.If I said "Yes" then it ok ,but If I select cancel button,its generate the Error message.The exception is

Upload a File to a SharePoint Document Library - Part I

The following helper class demonstrates a few techniques that allow documents to be uploaded to a SharePoint document library programmatically without using the API or a custom web service. You don't need to specify a document library name, and it will create any folders specified in the URL as required. File meta data will be updated if any properties are passed.

SmtpClient and Locked File Attachments

Got a note a couple of days ago from a client using one of my generic routines that wraps SmtpClient. Apparently whenever a file has been attached to a message and emailed with SmtpClient the file remains locked after the message has been sent. Oddly this particular issue hasn't cropped up before for me although these routines are in use in a number of applications I've built.

How to call an .exe file in .net

Sometimes a developer has to call an EXE from another EXE. While calling EXE there can be a requirement to pass parameter.

ClientAccessPolicy file in SharePoint 2010

I am upgrading my Silverlight demo code from the old beta to beta 2 and see that there are a few new considerations for the deployment of ClientAccessPolicy.xml files. In a previous post I demonstrated how to do this for SharePoint 2007. The heartburn that I get with that approach is any site collection owner or designer can drag the file into the site collection and open the site up to unwanted client access issues. In 2010 the virtual path provider no longer serves the files from the root of the site collection

Multi File Upload Using JQuery!

Everyone knows about the file upload in .NET. But the multi file upload is some what difficult in .NET. For that purpose we can have some AJAX or JQuery!. Jquery is the latest advanced version. It will give some animated upload. You can try it for your own!!!!

Transfering a file from Conputer to PDA

You can transfer one file at a time between your computer and another Bluetooth device by using the Bluetooth File Transfer Wizard. For example, you can transfer files between your computer and a mobile phone or a PDA. You can also transfer files between two computers that use Bluetooth.

The Free Barcode Creator produces barcode images one at a time, and allows easy saving to a file or

The Free Barcode Creator produces barcode images one at a time, and allows easy saving to a file or pasting into an application. 2D versions are also available:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend