The intersection of technology and leadership

Tag: .Net

Visual Studio 2005 Annoyances

Anyone who has worked with me knows how much I enjoy working with mainly the keyboard alone. IntelliJ and Eclipse have great ways of doing things with the mouse, and as I’m finding out, Visual Studio has a plethora of them as well. Unfortunately many of them trigger hidden buttons or menu items that don’t exist. We accidentally turned on a “feature” of showing spaces as dots and took a while searching out how to turn if off as shown in the diagram below.

Visual Studio showing spaces as dots

If it ever happens to you, you apparently have to drag a button onto one of the menu bars in order to disable it. Otherwise try the short cut keys, CTRL-R followed by CTRL-W. Of course…

Getting NUnit ASP to work with .Net 2.0

On my current project we’ve been having a pretty good experience leveraging the NUnitASP library for automated testing of our website. In our second week of development, we noticed like many other people, that it is yet fully compatible with .Net 2.0 because of the way that ASP.Net now generates its javascript postback functions.

In the previous .Net version, ASP.Net seemed to generate a very simple function of the form of __doPostBack([targetId], [targetArguments]) that would effectively set two hidden variables (__EVENTTARGET and __EVENTARGUMENT respectively). In the current version, ASP.Net generates a much more complex javascript function (called WebForm_DoPostBackWithOptions) that I think is caused with use of any of the ASP validator components.

One work around that one person (Lance Ahlberg) found was to turn the “CausesValidation” property off for controls but this may or may not suit the way that you are developing your website. Looking at what the javascript generated does, I think that there must have been a better solution so I spent some time delving into the depths of NUnit ASP to find one.

The result is a patch to ControlTester.cs that allows the __EVENTTARGET and __EVENTARGUMENT to still be set by extracting out the appropriate values from the new WebForm_DoPostBackWithOptions javascript function. You can download the patch here but you have to build your own NUnit ASP, or wait until this is integrated with the next release. The ticket for my submission can be found here.

.Net 2.0 and IIS

I know this is old, but I’m putting up here as a note to myself… the installation order of IIS and .Net 2.0 matters. If you try running .Net 2.0 code on IIS that thinks it’s running a prior version of .Net (see the bottom part of the IIS error page to see what it is running), run the aspnet_regiis.exe /i command that sits deep in the bowels of the %windir%\Microsoft.NET\Framework\v2.0.50727 folder to make it run fine again.

© 2024 patkua@work

Theme by Anders NorenUp ↑