John Stagich's Blog

Microsoft .Net Developer

November 2008 Quick Hits

clock November 8, 2008 13:42 by author johnstagich
  • Enterprise Library 3.1: Enterpise Library Configuation Editor Problem

An application I was working on needed to run on with the Entiprise 3.1 Library.  When I tried to use the Enterprise Library Configuration editor (EntlibConfig.exe) on my app.config file, I was getting errors that it could not locate the specific libraries/.dll’s.  The problem was that my libraries in my code where strongly named (PublicKeyToken=b77a5c561934e089) while the Enterprise Library Configuration Editory was looking for libraries with the PublicKeyToken set to null (PubliKeyToken=null).  The fix was to use the RIGHT Enterprise Library Configuration editor.  There are two of editors.  One resides in C:\EntLib3Src\App Blocks\bin and the other resided in  C:\Program Files\Microsoft Enterprise Library 3.1 - May 2007\Bin.  The former works with non-signed libraries while the latter works with signed libraries.  From the Visual Studio Development environment, I changed app.config editor to point to the C:\Program Files\Microsoft Enterprise Library 3.1 - May 2007\Bin editor.

For more information, check out this link from Tom Hollander on Avoiding Configuration pitfalls with incompatible copies of Enterprise Library.

  • How do you debug a Unit Test in Visual Studio 2008?

1) Set a breakpoint in your test, and then from the Visual Studio menu: Test-->Debug-->Tests in Current Context.

2) Set a breakpoint in your test. Go to the Test Results window (from the Visual Studio menu: Test-->Windows-->Test Results).  From the toolbar in the Test Results window, click on Debug drop down icon and then select Debug Checked Tests.

3) Try entering System.Diagnostics.Debugger.Launch() and System.Diagnostics.Debugger.Break() into your Unit Test code and then run your Unit Test  You then will be prompted with a Visual Studio Just-In-Time Debugger dialog box.  Select the default selection.  You should then break into your Unit Test code.

  • Here is a good link to the How Do I Video Series for Visual Basic.
  • For the datagrid view control, if you want the NewRowNeeded event to fire, the VirtualMode property for the datagrid view control needs to be set to true.
  • From Scott Mitchell's blog, I found out about a product called ELMAH that may come in handy down the road.  ELMAH (Error Logging Modules and Handlers) is an application-wide error logging facility that is completely pluggable. It can be dynamically added to a running ASP.NET web application, or even all ASP.NET web applications on a machine, without any need for re-compilation or re-deployment.
  • Have you ever wanted to share a common file among project? Check out Sara Ford's tip number #365 that shows how to link a file. (I wonder how this works with Team Foundation Server Source Control?).  Tip number #364 is good too.  Visual Studio comes with an image library.

  • FromScott Gu's blog, new ASP.Net Chart control.

  • The table designer in Microsoft SQL 2005 I find is lacking because I cannot find a way to add properties to the columns displayed.  It only displays Column Name, Data Type, and Allow Nulls.  From Rich Strahl's Web log, comes a work around.  Use the Database Diagram Designer.   Right mouse click on the Database Diagrams folder and click New Database Diagram.  Next add your table.  Right mouse click on the table-->Table View-->Modify Custom...

October 2008 Quick Hits

clock October 1, 2008 08:43 by author johnstagich
  • SQL Server 2005: Reporting Server Error 1053-The service did not respond to the start or control request in a timely fashion

I am now starting to work with Microsoft Reporting Services (SQL 2005).  The SQL Server Reporting Services service would not start.  It looks like one of the Hot Fixes for SQL 2005 mucked something up.  Anyway, it required a registry fix and a reboot.  Here is the link  

You may want to check out this link also

  • Enterprise Library 4.0: Getting Exception Handling and Logging to Work

I have been working with the Enterprise Library 4.0 extensively.  I  had already implented the Data Access and Cryptography application blocks with no problems.  However, I did run into problems with the Exception Handling and Logging Application blocks.  In order to get the Exception Handling to log a message to the Application Event log, I had to add a reference to the Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.Configuration.Design.dll (Enterprise Library Exception Handling And Logging Application Block Design) library.  In order to get the Exception Handling to log to the Database, I had to add a reference to the Microsoft.Practices.EnterpriseLibrary.Logging.Database.dll (Enterprise Library Logging Application Block Database Provider) library.  Both of these references were not mentioned in the documentation that I was using.

  • Windows Forms: Controlling Event Firing

While working on a Windows application, the SelectIndexChanged event with the ComboBox control was firing unintentionally. I only wanted the event to fire when the user changed the value in the combo box. Doing some research, I was presented with two options (see link). One, use a boolean flag to monitor what was causing the event to fire. The second was to remove and add the SelectIndexChanged event handler for the ComboBox at appropriate times in your code. I chose the latter. It really is quite simple.

Remove Handler: RemoveHandler comboBoxProduct.SelectedIndexChanged, AddressOf comboBoxProduct_SelectedIndexChanged

Add Handler: AddHandler comboBoxProduct.SelectedIndexChanged, AddressOf comboBoxProduct_SelectedIndexChanged

  • ASP.NET Website Development - Displaying Images from SQL Server Database

I picked this information up from a David Hayden blog post.  I had a project at a former employer where this code could have come in handy.  I can imagine possibly getting a similar request to display images from an SQL database in the future.  Here is the link


About the author

I am the owner of Stagich Software Consulting.  Stagich Software Consulting specializes in developing Microsoft .Net/Microsoft SQL software applications.



<<  July 2022  >>

View posts in large calendar

Month List


The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

Sign In