- 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...
Here are two more Team System/.Net/SQL/ resources.
Team System User Group - Virtual Edition
Screen Cast A Day
- A recent task required me to populate and existing table inside an Microsoft SQL database from a flat .txt file. The T-SQL Bulk Insert command performed the task nicely.
Step 1: Create Format File with the bcp command. (If your your input and output file layouts are alike, this step may not be necessary.)
Log on to the machine where the database resides. Open up a command window and navigate to the binn directory (Program Files\Microsof Sql Server\...). The binn directory is where the bcp command resides.
From the command line enter:
bcp DatabaseName.Owner.TableName format nul -S ServerName -T -n -f Products.fmt
For more information on creating a format file see http://msdn.microsoft.com/en-us/library/ms191516.aspx
Step 2: Run Bulk Insert Command
--Without Format File
Bulk Insert dbo.fp_Products_work
--With Format File
Bulk Insert dbo.fp_Products_work
Gotchas: 1) Your SQL Server account must be a member of the sysadmin or bulkadmin roles in order for you to use the Bulk Insert command. 2) In SQL 2000, the From clause does not allow you to use a variable (@Path) to provide path informatioin. My workaround in my stored procedure was to dynamically create an SQL string, and then execute the sql like so: Exec (@sql.
- Working with the DataGrid Control: Dynamic Bound Columns OnSortCommand event not being called.
Problem: The event/routine specified in the OnSortCommand attribute in the aspx:datagrid control was not being fired. I was also binding the datagrid columns dynamically in the code behind page.
Fix: When binding columns in the DataGrid dynamically, do so in the Page_Init event. By doing so, the event fired, and I was then able to sort the data.
Helpful Links: http://www.velocityreviews.com/forums/t97260-dynamic-bound-columns-onsortcommand-not-called-solution.html
I posted code on the link below showing how to sort columns in an ascending and descending manner.
- Adding filter action to the ASP.NET FileUpload Control
Problem: The FileUpload control does not have a property to specify filter action on the FileUpload control. The following link provides techniques for filtering on both the client and server side: Adding Filter Action to FileUpload control of ASP.NET.
I am a big fan of Sara Ford's tips and tricks blog. I met her recently at the devLink conference in Nashville, TN.
One of my favorite tips, is how you can configure a macro to increase or decrease you font size from within your Visual Studio IDE. It is tip 242.
Sara has also recently written a book, Microsoft Visual Studio Tips, which will be released in October.
Here is a new webdevloper tips and tricks blog I found out about from Brad Abrams' blog: http://blogs.msdn.com/webdevelopertips/default.aspx
Another one that has been around for awhile is Scott Guthrie's tips and tricks page.
I picked this up from Scott Michell's blog and thought I pass the word. Scott Hanselman has a web page on his blog that provides a comprehensive list of developer tools. He updates the list annually. I think it is fantastic. Here is the link Ultimate Developer and Power Users Tool List.
I recently purchased Camtastia Studio 5 in order to create "How To" videos. My first "How To" video, How Do I: Return a text/value pair or key/value pair to the Ajax AutoCompleteExtender is now available under the Presentations menu tab on my web site www.JohnStagich.com
This video (.wmv) shows how to get a web service to return a text/value or key/value pair to the Ajax AutoCompleteExtender.
Recently, I have been seeing an Apple commercial on TV that rags on Vista. I am starting to think Apple may have a legitimate point.
I go and insert a CD into my DVD/CD drive. I open my Windows Explorer and I do not see my DVD/CD-ROM drive. Ok, what is going on. I have not installed any new hardware or added or removed any programs recently (other than Vista updates). I proceed to Control Panel->Hardware and Sound->Device Manger->DVD/CD-ROM drives. Sure enough, there was an error icon on top of the drive. I select properties and see the following message:
Windows cannot load the device driver for this hardware. The driver may be corrupted or missing. (Code 39)
OK, there is a button to click on to help solve the problem. I click on the button--totally useless. I then resort to Googling on the error message and came up with the following fix: http://support.microsoft.com/default.aspx?scid=kb;EN-US;314060 (use Method Two), which involved deleting two entries from the registry and rebooting my PC. The fix worked and I was able to see my DVD/CD-ROM drives.
We are now almost half-way through 2008, and I am working with an OS that
Does not notify me that a critical hardware device is not working.
Provides no immediate help to fix the problem.
Requires me to perform an arcane maneuver to fix the problem.
I believe Vista is a big improvement over XP; however, a basic problem like I described above should not be happening.
I picked this information up from a Dave Hayden blog post.
ZoomIt is a Screen Zoom and Annotation Tool for Technical Presentations created by Mark Russinovich and it is FREE!
Here is a brief description of the tool from the download page:
ZoomIt is screen zoom and annotation tool for technical presentations that include application demonstrations. ZoomIt runs unobtrusively in the tray and activates with customizable hotkeys to zoom in on an area of the screen, move around while zoomed, and draw on the zoomed image.
I downloaded the application and tried it out in my Visual Studio 2008 IDE. It worked great and it is super easy to use.