Posts

Showing posts from October, 2006

Visual Studio 2005 Debugging Tip

Image
Have you ever been debugging an ASP.NET 2.0 application and you see "First Chance Exception XXX" in the Output Window while you are putting the app through its paces in Debug mode, but the IDE never breaks on any of them? And you are saying to yourself, How can I debug this thing if all I see is cryptic messages in the Output Window but no source code, line numbers or anything else? What you want to do is tell the Debugger to Break on all Managed Code Exceptions. Here's how: 1) In the IDE, up top, hit "Debug" and Choose "Exceptions". You will see a dialog with a Treeview (collapsed) the second node of which reads "Common Language Runtime Exceptions". At the right will be a checkbox. Check this checkbox. (If you want, you can expand the treenode and pick and choose which kinds of exceptions you want the debugger to break on when thrown). You need to check this (these) because the default behavior is "continue". In fact, you can even ...

Few Things to Think About on your way to the Polls

Republicans have some pretty good reasons to show up at their polling places on Election Day. You may not share my views, but I hope you'll take the time to vote, too: More than 6.6 million new jobs have been created since August 2003, and that's after we inherited a nasty downturn and stock market bubble from the Clinton Administration. Our 4.1% annual growth rate is superior to most other major industrialized nations. The Dow has set record highs multiple times in the past several weeks. Productivity is up, the deficit is down. Real after-tax income has grown by 15 percent since 2001. Inflation has remained low. The tax cuts proposed by President Bush and passed by a Republican Congress are working! And, by the way, all this Liberal BS about "record deficits" is exactly that - BS! The deficit as a percentage of current GDP is right in the historical ballpark, my friend. Democrats will attempt to mislead you with a lot more of their narrow "statistics", of...

Web 2.0 Overload Comin' At Ya!

Think about it: There are HUNDREDS of these "Web 2.0" sites that have sprung up in the last year or eighteen months. Most of them are simply re-works of existing concepts: Video sharing, Social Bookmarking, Feed Reading, and so on. They are all competing for the same set of eyeballs, more or less. Think about the "Web 2.0" sites that you really, really use consistently. I know which ones i use: Google Reader Digg Del.icio.us Google personalized home page Flickr (infrequently, though i do have some photos there) YouTube (I just visit) Live.com (mostly just visit) -- That's about it, the "Short list". Sure, i look at the new ones. But almost without exception, I visit once or twice, determine if I am really interested, and you never see me there again. When I look at this list, there are really only 3 that I ever use consistently: Digg, mostly for entertainment, because it's populated in the main by 20 and 30 -something Liberal geeks, and I am a bit ...

Cross-Application Forms Authentication

I've seen some confusion about how and whether you can have a user who has been "Forms-Authenticated" on one application or site be able to go to or be redirected to another application or site (or the "same" application on a web farm, which is essentially the same situation) and not have to re-authenticate. ASP.NET 2.0 sports a new Forms Auth property, "EnableCrossAppRedirects". This can be set in the Forms Authentication web.config node, e.g., ... enableCrossAppRedirects="true" /> The way this works is that the EnableCrossAppRedirects property is checked within the RedirectFromLoginPage method when the redirect URL does not point to a page in the current application. If EnableCrossAppRedirects is true, then the redirect is performed; if EnableCrossAppRedirects is false, the browser is redirected to the page defined in the DefaultUrl property. However, this is not sufficient to get you to "First Base". The name, protection, path...

Google Co-op Search and Expression Web (Designer)

Google Co-op search has been worked over very nicely. I am expermenting with one in the footer of these blog entry pages. This particular one does targeted search on .NET-related topics, and searches a long list of blogs, including many from the Microsoft Bloggers OPML, which I have imported. I hope to add more soon. Here is the homepage of the co-op search . You can also open these up for collaboration by sending invites to others, and then have a whole group of people that can add target search sites/ blogs to your Search Engine. This isn't as open as I had hoped, because it appears you have to invite your collaborators first. My theory, instead, is to let anyone add a search target site or blog, and then the admin(s) would either approve or disapprove it. I say this because they've done a very nice job on their custom Google Groups. I started one about open - source software sometime ago (has over 200 members now) and as admin, I can go on and set settings for new users, mo...

A Note About C# and Interfaces

Interfaces seems to be one of the biggest conceptual problem areas for beginning developers. Some people just have difficulty understanding what an Interface really is, but more often, developers can understand what it is; it's just that they have difficulty getting a grasp on "what it is for". Recently on the C# MS Group there was a post that basically revolved around the concept of "why do I need interfaces" vs. Multiple Inheritance and so on. There were two very good responses, one, a real "gem", by Marina Levit, an MVP who has a penchant for succinct and highly detailed instructional replies on the newsgroups, and another by "DeveloperX" - an unnamed but equally proficient poster. I reproduce them here: Levit: Interfaces are meant for classes that have the same behavior, but different implementation for that behavior. For example, a Person object might implement a Move method one way - by walking. A Car object might implement a Move metho...

Open -Source ASP.NET 2.0 CMS (Content Management Systems)

I got interested in the current state of the ASP.NET 2.0 CMS system marketplace, mostly from the point of view of whatever is either source-code-available, or open-source. I have a post on the MS C# newsgroup about this and it looks like, from the initial response, that there are more than a few people who share my interest. I've already looked at about five of them, including Umbraco, axCMS, SharpNuke (a C# port of DNN that is faithful to the original VB.NET version and converts to ASP.NET 2.0 very nicely) and a couple others. As I go on my travels looking at these, if anybody wants to post a suggestion of one that you like I'll be happy to review it. Requirements: 1) Must be either open-source or a free non-restrictive "GPL" type license that allows you to modify the code. 2) MUST be either in ASP.NET 2.0, or can be easily converted. 3) Must be able to be deployed in a shared hosting account environment where you may not have direct access to either IIS or the desk...

Iterating List <T>

A question popped up on the C# group that covered something very nicely: How can you iterate (foreach) over a Generic List? If you're using List then iteration should be fine - List<> has GetEnumerator() defined. Using a list List<FooClass> MyList = SomeBarFunctionThatReturnsAList(); Foreach(FooClass foo in MyList) { doSomethingWith(foo); } If you're using a custom collection class that you made yourself, then it needs to implement the IEnumerable interface, which is a lot easier than it sounds. To implement IEnumerable, you just implement GetEnumerator, and then you get to play with the new "Yield Return" statement,which automatically wraps the method in an enumerator object. Using a custom class that wraps around a List private List<FooClass> myList; public IEnumerator GetEnumerator() { foreach (foo in myList) { yield return foo; } } This message has been brought to you by the words Foo and Bar.

Visual Studio 2005 Service Pack 1 BETA

http://www.microsoft.com/downloads/details.aspx?FamilyID=8D702463-674B-4978-9E22-C989130F6553&displaylang=en#QuickInfoContainer Did I say it's "BETA"? It is. NOTE 1: Somasegar says this may be incompatible with Windows Vista. NOTE 2: If you have the Web Application Project add-in installed, you must uninstall it first before applying the Service Pack. The pack includes the latest version of it, and will install it for you. See note number 4 for an issue where it "looks like" you've lost your Web Application Projects! NOTE 3: As with many MS installations, this may sit near the end with "Time Remaining: 2 seconds" for up to 30 minutes or more. Just get over it and wait. NOTE 4: There is an issue that WAP templates may not be installed correctly unless you run: "c:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.exe" /InstallVSTemplates Without this you could run into one of the following: If you previously had WAP you will g...

Windows Vista RC2 - Build 5744 Out Today

Today Microsoft released what is expected to be the final build of Windows Vista to leave Redmond before the final RTM code. 5744, like its predecessor, is built on the final RTM source code branch. My only issue with RC1 (x64) was that it couldn't perform an upgrade over a pre-existing Windows XP x64 edition. That meant I'd have to spend hours reinstalling various pieces of software, a luxury of time that I can't afford right now. I installed the 32 bit version on a separate partition on my plain vanilla Gateway AMD Turion notebook, but it would not recognize the sound card, so I gave up. The main issue with this stuff, at least from the 64-bit standpoint, is driver compatibility. The same thing happened with Windows Server 2003 and Windows XP x64 - the manufacturers were slow to arrive at first base with their 64-bit drivers. We will see how it goes this time, eh?

Note to Self: SET NOCOUNT ON, "NOT"!

I'm creating this web page for our Network Operations Center that allows them to test a specific mission - critical webservice that handles VOIP calls. It's basically a Web-based API for our internal Sip Proxy and Media servers, that I wrote. It allows any kind of device that can consume a standard WebService to use our VOIP Calling API. So I've got like 30 different methods, and this page will iterate over every method, making a test call, and it populates a DataGridView with a new row that is colored green for success (with the results information) or red for failure, that includes any exception information, for every one of the methods in the test suite. So the guys in the NOC who need to have everything completely "idiot proof" can simply bring up this page, press the "Start" button, and watch it dynamically refresh as each method is called. All green, you are "OK". If you have a red row, you have a problem. If a method is supposed to do a...