Logging in .Net and My.Application.Log.WriteEntry does not write until flush

In app.config you need to remove the default listener:

<remove name=Default/>

Documentation on MSDN is ok, when testing you need to remember that the log will not write until either the application is closed, or the log is flushed. So:

My.Application.Log.DefaultFileLogWriter.AutoFlush = True
My.Application.Log.DefaultFileLogWriter.Flush()
My.Application.Log.TraceSource.Flush()

 

 

Advertisements

Loading WPF User Control at runtime

Need to place the user control in a control that accepts content. My current favourite is a “ContentControl”.

Me.ContentCanvas.Content = userControlValue
Me.ContentCanvas.Content = Nothing

Some other controls require Add.

Beware that a StackPanel will expand to fit all content, so if you put a DataGrid and possibly a ListBox in there, there will be no scroll bar.

Unable to apply publish properties for item “ApplicationCode\SystemNames.xml”

Solved with thanks to:

http://stackoverflow.com/questions/9284375/unable-to-apply-publish-properties-for-item-x

“It appears that the issue is related to ClickOnce. Navigate to the project, right click on it and click on properties. Go to the Publish tab and click on Application Files. Check the ‘Show all files’ checkbox and scroll through the list of files. Eventually, you will come across the file that has a yellow exclamation point on it. This file is orphaned and needs to be removed. Right click on the file and there should be a remove option.

Now build the solution and the warning should be gone.”

Subversion Windows Explorer Add-In Enable/Disable

 

http://www.howtogeek.com/howto/21106/how-to-enable-or-disable-tortoisesvn-menus-easily/

This works

Q&A BWT

 
Help system ?
UML or other design documentation
SQL manipulate from where ? SSMS or VS
Certification – Too difficult – too much detail on individual subjects. MCTS 70-433 SQL Server Development
BIDS – SSRS – SSIS – SSAS
Any experience of T4 v CodeDom
Grog Talk interactive idea – How Visual Studio could be better
Naming Conventions
Data access technologies – Datasets – Directly coded – LINQ to SQL – Entity Framework ?
LINQ – Lambda

My Other Blog Start

Technorati Tags: ,

This blog is intended for non-IT posts.
Not certain of content at the moment