Wednesday, June 25, 2008

I'm sure most of you know about podcasts. Sites like .NET Rocks being one of the most popular for .NET developers. Sooner or later though, you just run out of podcasts. Especially if you, like me, try to waste no time - which includes walking your dog with an MP3 player plugged in :-)

There are also cases when the level of podcasts is way below what you would expect. Once you get a certain level of expertise in any subject, most of the podcasts start to sound lame and that is natural of course - a sign of you progress.

Worst case scenario however is, when there are no audio materials on the subject of interest. Been there, seen that, solved it.

Enter SpeechR.

A small tool that I wrote mostly for myself. SpeechR is a tool that allows me to take any text and convert it into an audio format (wave or mp3) so I can later put it on my MP3 player and listen to while... whatever I do that doesn't require focus.

With all the ebooks out there, with all those lenghty manuals or blog posts and a comming vacation on a beach... What more can a hardcore can you want.

Tool uses System.Speech namespace that was introduced with .NET 3.0 to generate sounds. System.Speech in turn uses Microsoft Speech API found in Windows. With version 5 it got pretty good. Just compare Microsoft Anna in Vista to Microsoft Sam in XP.

Of course, Microsoft's voice isn't perfect - far from it. There are however commercial voices out there that are very good and cost ~30$.

Well. The tool is free, you can install it and enjoy. Please let me know what you think about it and what features you would like to see in v.Next().

Wednesday, June 25, 2008 7:37:27 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [4]  | 
 Tuesday, June 24, 2008

I'm having some very strange problems lately with my Visual Studio. From time to time, a random feature just stops working. From not being able to pin/unpin windows, through random component not installed/missing, to just not being able to even start the IDE.

Some of the problems go away after restarting Visual Studio. Some of the problems go away after restarting Windows. Some of the problems just STAY!

After asking "Deep Thought" for the ultimate answer to life, I got it, and it was 42...

Naaah. Actually asking google was helpful in a way. It gave me some clues on what can I do to "reset" Visual Studio without reinstalling it or even worse, the whole Windows. The answer was:

devenv /resetskippkgs

Remember this one. You will need it. Sooner or later, but you will. It solves a lot of different issues.

Tuesday, June 24, 2008 9:08:45 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [5]  | 
 Friday, March 14, 2008

Internet Explorer Enhanced Security Configuration - don't you just love it?

Is there anything worse that Microsoft has given us over last few years? I really doubt it.

Friday, March 14, 2008 5:29:12 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [2]  | 
 Saturday, September 22, 2007

In my last article on opening a file in Visual Studio, I have described how to write a macro to open a file given it's name. Now we can take it one step further. How about opening a file containing a type name.

Unlike opening a file, where there is a built in function, searching for a type is a complicated task. We need to loop over all projects, all items, and then analyze the code. Other than that, the code is rather simple if you understand recursion:

Sub OpenType()
    Dim typeName As String = InputBox("Type name:").ToLower()
    If String.IsNullOrEmpty(typeName) Then
        Return
    End If
    Dim str As String
    Dim projectItemContainingType As ProjectItem
    For Each project As Project In DTE.Solution.Projects
        projectItemContainingType = FindProjectItemWithType(typeName, project.ProjectItems)
        If projectItemContainingType IsNot Nothing Then
            projectItemContainingType.Open()
            projectItemContainingType.Document.Activate()
            Return
        End If
    Next
    MsgBox("Type not found", MsgBoxStyle.Information)
End Sub
Private Function FindProjectItemWithType(ByVal typeName As String, ByVal projectItems As ProjectItems) As ProjectItem
    Dim projectItemContainingType As ProjectItem
    For Each projectItem As ProjectItem In projectItems
        Dim codeModel As FileCodeModel = projectItem.FileCodeModel
        If codeModel IsNot Nothing Then
            projectItemContainingType = FindProjectItemWithType(typeName, codeModel.CodeElements)
        End If
        If projectItemContainingType Is Nothing AndAlso projectItem.ProjectItems IsNot Nothing AndAlso projectItem.ProjectItems.Count > 0 Then
            projectItemContainingType = FindProjectItemWithType(typeName, projectItem.ProjectItems)
        End If
        If projectItemContainingType IsNot Nothing Then
            Return projectItemContainingType
        End If
    Next
    Return Nothing
End Function
Private Function FindProjectItemWithType(ByVal typeName As String, ByVal codeElements As CodeElements) As ProjectItem
    Dim projectItem As ProjectItem
    For Each codeElement As CodeElement In codeElements
        If codeElement.Kind = vsCMElement.vsCMElementClass OrElse codeElement.Kind = vsCMElement.vsCMElementEnum Then
            If codeElement.Name.ToLower() = typeName Then
                projectItem = codeElement.ProjectItem
                Return projectItem
            End If
            Continue For
        End If
        If (codeElement.Children.Count > 0) Then
            projectItem = FindProjectItemWithType(typeName, codeElement.Children)
            If projectItem IsNot Nothing Then
                Return projectItem
            End If
        End If
    Next
    Return Nothing
End Function

Some shortcut to OpenType procedure (like Ctrl + o, Ctrl + t) and you are ready (I describe how to assign a shortcut in my previous article). It finds top level classes and enums. I have found that searching for inner types - like class or enum defined inside another class, makes it run very slowly - but that is nothing we cannot handle.

If you think you like working with macros and need a bit of practice, there is one thing that can be done that will speed things a lot: instead of searching the whole solution for a type, every time, just build a dictionary of typename/projectitem. That will make your searches lightning fast. Just keep in mind that you have to update this cache every time someone adds or removes types. This is not an easy thing to do! Not by far!s

kick it on DotNetKicks.com

Saturday, September 22, 2007 6:24:14 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [2]  | 

The one thing that I always miss in Visual Studio is a quick way to open a file that is part of a solution. By "quick" I mean not requiring a mouse action and with minimal amount of typing. It came out that it is indeed possible to do so without any addon's. As Robert Prouse shows in his blog entry on Quickly Find/Open a File in Visual Studio, we can do so by using the Find drop down (usually it can be found on a toolbar). You get there by pressing Ctrl + d or Ctrl + /. Also in the comments to his post, there is a hint, that we can use a Ctrl + Alt + a to open a command window where you can issue commands like "open [filename]". Cool things indeed. But there is more to it!

I decided to play a bit with Visual Studio Macros and see what I can come up with.

The first thing was writing a macro for opening a file. Functionality similar to the above mentioned, but implemented using macros (later I will write why I decided to reinvent the wheel). As it came out, the documentation on the subject is not very good. It hardly exists! So I had to experiment a bit and after a while I had it working.

To make a Macro step by step:

  1. Run Visual Studio
  2. Press Alt + F11 (or go to Tools->Macros->Macro IDE... menu item)
  3. Under MyMacros, add a new Module.

In the newly added module, start writing code. It is VB.NET so it may cause a little discomfort for a C# developer, but it shouldn't be a major problem.

My procedure for opening files looks as follows:

Sub OpenFile()
    Dim fileName As String = InputBox("Open file:")
    If String.IsNullOrEmpty(fileName) Then
        Return
    End If
    Dim item As EnvDTE.ProjectItem = DTE.Solution.FindProjectItem(fileName)
    If item Is Nothing Then
        MsgBox("File not found", MsgBoxStyle.Exclamation)
        Return
    End If
    item.Open()
    item.Document.Activate()
End Sub

When the code is ready, save it and return to the main instance of Visual Studio and set up a shortcut key.

Setting up a shortcut is easy:

  1. Go to Tools->Options->Environment->Keyboard
  2. Find your macro
  3. Set up a shortcut key (such as Ctrl + o, Ctrl + f) and press assign

From now on, you can use the macro.

The drawback of using this method for opening files is that it does not provide intellisense support, but we can do more with macros than just opening files... Just read my next post.

kick it on DotNetKicks.com

Saturday, September 22, 2007 6:06:32 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [3]  | 
 Friday, July 20, 2007

For a couple of months now I've been running Windows Vista and Visual Studio 2005 without major problems (other than the commonly known ones). Since the first day of this setup I have been working on solutions that inlcude from one to many ASP.NET web applications. All of them are configured to use IIS rather than the built in web server. For all that time, everything was working fine until recently...

One of those days, while opening one of the solutions in Visual Studio, I was presented with a message telling me that my site is configured to use ASP.NET 1.1:

---------------------------
Microsoft Visual Studio
---------------------------
The site 'http://localhost/WebSite' is currently configured for use with ASP.NET 1.1.4322.573. Microsoft Visual Studio has been designed for use with ASP.NET 2.0; if not configured some features may make incorrect assumptions, and pages designed with the tool may not render correctly.

Would you like the site to be configured for use with ASP.NET 2.0?
---------------------------
Yes   No   Cancel   Help  
---------------------------

Needles to say that there were no changes made to IIS configuration of Application Pools or the pool the site is running on, but just to be sure, I've checked IIS Manager. The pool for the site was ASP.NET V2.0. I have agreed and allowed Visual Studio to make the "necessary" change. Needles to say, that nothing was changed in scope of application pools by Visual Studio. Fortunately, my solution kept working after that... for few days.

After few days I've got the very same message. Again, nothing was changed in IIS. This time I decided to leave my supposedly ASP.NET 1.1 in place. Of course everything worked after that also. Including debugging! But then I have the same message every time I open any of the solutions :-(.

I have found that other people also had this problem, and "aspnet_regiis -i" helped them, but it doesn't work for me :-(

Today I noticed that it gets worse. Now I get the message every time I open any of my solutions that include web sites :-(

Friday, July 20, 2007 2:05:07 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [5]  | 
 Monday, July 09, 2007

There is a very useful feature in Visual Studio since I remember. It is accessible through Debug->Exceptions... menu item. It allows you to specify when you want the debugger to break. By default, it is when an exception is unhandled, but to make sure, everything works as expected, I often turn the when thrown option on. This allows me to detect all exceptions that are thrown in my code, even those that I handle but shouldn't.

Normally the Exceptions window looks like this:

But for some unknown reason, mine looked like this:

Notice that there is no User-Unhandled checkbox column. For some reason I just needed to have this column so I went searchin over the internet, and I have found that the reason for not having the checkbox column for User-Unhandled exceptions is the setting I have made in some other part of Visual Studio: Tools->Options...->Debugging->General->Enable Just My Code (Managed Only).

After checking the above mentioned option, the checkbox was back!

Monday, July 09, 2007 12:33:00 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [3]  | 
 Thursday, July 05, 2007

Coming from MySQL and PostgreSQL background I am used to tools such as mysqldump for getting a complete dump of an SQL database into an a file. The file then contains SQL commands for creating the database structure and more importantly, for filling it with data using INSERT statements. A nice feature indeed.

Since I've begun working with Microsoft SQL Server, it has always been a problem for me to get the same result. There is no command line utility that I know of that comes with SQL Server 2000 that allows you make the same dump as mysqldump provides. There is however a hidden feature in the Enterprise Manager that you can use to achieve the more or less same result as with mysqldump. I have written about how to get the database schema using Enterprise Manager some time ago. The problem is that it does not work for SQL Server 2005 - there is no Enterprise Manager for v2005! The Microsoft SQL Server Management Studio does not have that useful feature so we are left alone... Or maybe not.

Some time ago I was determined to find a solution for this problem. So I have searched high and searched low, and I have found something. The thing is the Database Publishing Wizard. It does exactly what is needed - it dumps the schema, the data and even stored procedures if any are available! It has a command line interface, a GUI interface and on top of it it integrates with Visual Studio!

What more can you want?

kick it on DotNetKicks.com

Thursday, July 05, 2007 10:19:44 AM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [2]  | 
 Wednesday, July 04, 2007

Everyone knows the using statement. The statement that deals with IDisposable interface for us in a clean to write way. There is however one feature of this statement that is almost never mentioned. The feature I'm talking allows for multiple objects initialization of variables. Usage looks as follows:

using (SqlConnection conn1 = new SqlConnection(), 
    conn2 = new SqlConnection())
{

}

This way, both conn1 and conn2 will be disposed - no need to write 2 nested usings.

There is a note about this feature on MSDN but I've not seen it mentioned anywhere else.

Wednesday, July 04, 2007 8:34:02 AM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [4]  | 
 Tuesday, July 03, 2007

I cannot remember how many times I was entering the same piece of code over and over again with few (if any) changes. The piece of code that I'm talking about is an event handler method with a signature similar to the following:

protected void Accept_Click(object sender, EventArgs e)
{
    //....
}

The whole structure is method is usually the same. We have access modifier, a name of an object, an underscore, a name of an event and finally the sender and EventArgs part of which only three things tend to change.

Keeping this in mind I have created a code snippet that saves me a lot of time when I need to create event handlers manually (which usually happens when working with ASP.NET controls).

Some time ago I have written an instruction on how to use code snippets and also I have provided a couple of useful snippets. The new snippet added to the collection is used by typing "eventh" and it allows for customizing 3 parts of an event handler that are most likely to change.

kick it on DotNetKicks.com

Tuesday, July 03, 2007 10:01:48 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [2]  | 

While working with some obscure Microsoft's technology called MPS (Microsoft Provisioning System) I've been presented with one of the best error messages ever: "The server is unwilling to process the request.". So now we have to ask servers if they are willing to help us? Huh?

Tuesday, July 03, 2007 6:36:13 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [3]  | 
 Friday, June 29, 2007

Today while I was working on my usual solution inside Visual Studio I have encountered a serious problem with how Visual Studio, SourceSafe and Web Site projects interact. My solution that I was working with consists of several projects including few Web Sites. My environment is configured to use SourceSafe database as a version control system. Nothing unusual - a 100% Microsoft only environment. I had been working like this without any changes to the configuration for a long time but I noticed that no matter what I do, my solution file (.suo) is growing larger and larger...

Since .suo (solution user options) files only contain information about my options e.g.: opened files, break points etc I thought that it will not hurt much if I just delete this file. I didn't care about opened files nor the location of breakpoints. Besides, sometimes deleting the .suo file is just the only option to restore Visual Studio to a working state after it refuses to open a project file. On top of this, I have deleted the .suo file many times before without any negative effect. So I did again, but this time I was hit right between the eyes and I'm still recovering from the blow.

After deleting the file and starting the solution I got the following message:

"The Open from Source Control operation is still in progress but you can start working now. The rest of the projects will be retrieved asynchronously."

I thought, oh... OK, the message was not a warning and there are a lot of useless messages in Visual Studio so there is no need to worry. I was WRONG, but it came out some time later.

Everything opened correctly and it even seamed to work, but the pages looked different from what I was expecting. They looked exactly the same way as before I made my last changes that I didn't commit before the deletion of .suo file.

After a bit of investigating and testing I have found the problem. And the problem that is! It appears that if you have a file checked out inside of the Web Site project than the fact it is checked out is somehow remembered inside the .suo file. If you delete a .suo file then Visual Studio will try to be "smart" and will get the latest version of that file from the source control - SourceSafe in this case. What this means of course is that any changes in the checked out file will be lost WITHOUT ANY chance to stop and WITHOUT ANY warning message!!!

This issue is only a problem for Web Site projects. Other project types like Class Library are not affected. Now the questions are obvious: why Visual Studio is using .suo files to keep tract of what is checked in and what is checked out inside Web Site projects? Are .scc and .vspscc files not enough? Why would it even try to get the latest version? Is the fact that the file on the disk is not Read Only and is different from the version in the Source Safe not enough to at least issue a warring/question?

In my opinion it is obviously a bug and it has just caused me to lose half a day of work!

Friday, June 29, 2007 1:52:19 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [3]  | 
 Friday, May 11, 2007

For a long time now I have been working with only one monitor. For a developer it poses some difficulties like lots of overlapping windows. Without even really knowing how it is really like I have always been an advocate of a dual monitor setup. Now when I have a laptop and an external LCD I can only say that I was right, but at the same time wrong!

Two monitors give you much more space on which you can put your windows. For instance you can put a help window on one monitor and the code on the other. If you work with ASP.NET you can have a browser running on one of the monitors while you edit the code on the other and take advantage of Edit and Reload feature. Possibilities are almost countless. Almost...

The one thing that I was wrong about is the fact that my primary development tool: Visual Studio 2005 does not support dual monitor setup! Can you imagine? The only support available is that you can move SOME of the windows on to the second monitor. The windows you can move include Solution Explorer, Watch, Immediate and all the other dockable windows. Good as it is, I think it is only a side effect of those windows being draggable. The problem is that Visual Studio was never intended to be used on more than one monitor and that is why you cannot move the most important windows to the second monitor. What are the most important windows? For me it is the code window and the design window (ASP.NET).

At first I thought that I might be missing something. Some switch in the preferences. Unfortunately it is simply impossible according to the following sources:
http://blogs.msdn.com/saraford/archive/2005/07/20/441126.aspx
http://blogs.msdn.com/saraford/archive/2004/05/18/134295.aspx

That's a pity. I cannot wait for the next version of Visual Studio in hope that they will add the support for more than one monitor.

Friday, May 11, 2007 2:10:31 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [3]  | 
 Tuesday, March 20, 2007

From time to time I need to find out if the code that is currently executing runs in a Hosted Environment (like ASP.NET application) or not (like Windows Forms application). Mostly those kind of knowledge might be needed in reusable assemblies which deal with file access. For ASP.NET application you almost always need to call Server.MapPath method (or one of the equivalents). For Windows Forms Application you either do nothing or call something like Application.StartupPath.

There are many ways to tell if code is hosted or not. Usually I see code similar to the following:

if (HttpContext.Current == null)

This code however requires a reference to a System.Web.dll which may not be something you take lightly :-). So I thought: lets see how They do it - that is how Microsoft does it.

It appears that they use a System.Web.Hosting.HostingEnvironment.IsHosted property to make this check inside System.Web.dll. Still this is a System.Web.dll that you have to reference to make the check. I have been unable to find any alternative that does not require this reference, but hey! I'm a web developer mainly and I have nothing against referencing System.Web.dll :-)

Tuesday, March 20, 2007 11:11:26 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 
 Monday, March 19, 2007

I have always believed that each collection is by definition IEnumerable. That belief held true until today...

First let me define my loose definition of what a collection is. A collection is a set of objects. In .NET Framework I have noticed a special pattern for naming collection classes - they usually end with a Collection word. Examples include dozens of collection classes in System.CodeDom namespace, AttributeCollection or even ControlCollection. I'm so used to this kind of naming convention that when I see it I automatically know that I can do a foreach loop over it.

There is however at least one exception from this rule and that is a System.Web.UI.CssStyleCollection class. It is a class that derives directly from System.Object and it does not implement any interface which means no IEnumerable!!! When I looked at the public properties, they suggest that it should really be a collection. It has an indexer, it has a collection of keys and values. It even has a Count property not to mention all the usual methods for manipulating collection-like objects.

Strange, but true :-)

 

Monday, March 19, 2007 4:56:11 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [2]  | 
 Tuesday, March 13, 2007

There are a lot of articles on how you can debug you JavaScript code using Visual Studio 2005. There are basically two cases:

  1. Debugging ASP.NET pages inside the Visual Studio's solution.
  2. Debugging other pages - not included in the solution.

In the second case, all you have to do is attach to a process of a running Internet Explorer using Debug->Attach to Process... menu option, in the first case, all you need is to run the solution in debug mode.

The rest of the scenario is the same for both cases. Visual Studio allows you to open any script document currently loaded into the Internet Explorer process you are currently attached to. This is done via the Script Explorer window which you can turn on using Debug->Windows->Script Explorer menu option or by using the Ctrl + Alt + N keyboard shortcut. The window should look more or less like this:

The problem is that more often than not, debugging JavaScript in Visual Studio simply does not work! I have spent countless hours trying to find the solution or even the cause of this problem, but without success. There are many "solutions" on out there but none of them really solves the problem. Most of them simply don't work! Probably Microsoft fails to acknowledge this as a problem since it has been around for few years now - judging by the news group posts dates.

Tuesday, March 13, 2007 9:32:03 AM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [3]  | 
 Friday, March 09, 2007

There is a bug in Visual Studio 2005 (but I think I have also seen it in Visual Studio 2003) that causes multiple break points to be set in case you have few files with the same name opened using Script Explorer window. (if you are fortunate enough to have it working).

Steps to reproduce the problem are simple. Just ran a simple page with a Textbox and a Button control and some kind of Validation control. This will ensure that the presence of two "WebResource.axd" JavaScript includes: one for with Validation code and the other one - the standard ASP.NET one. Try to set a breakpoint in the first line of any of the script files included. Use Script Explorer window to get the files. Notice that the breakpoint appears in both files. Also sometimes the focus is moved to one of the other files. Imagine having a couple of scripts included in such a way and all those unneeded breakpoints!

As mentioned above, I have noticed this behavior also in Visual Studio 2003, but I have not tracked it down. I'm almost sure however that there was also the same type of problem also with normal files included in the solution. (yet again, I can't remember for sure).

Fortunately removing breakpoints works correctly so you can remove unnecessary breakpoints once they are created.

As a side note. While writing this article my Script Explorer windows stopped working and this also means that script debugging inside Visual Studio also does not currently work, so I'm unable to provide any more details. I hope though that Microsoft will correct this problem sometime in the future.

Friday, March 09, 2007 5:45:48 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [1]  | 
 Tuesday, February 06, 2007

Last time I have posted my observations on the Remember Password feature of Microsoft SQL Server Management Studio. Today it got even worse! Not only MSSMS forgets my password on a random basis, It prevents me from logging in with a correct password! Yeah I have written about it last time, but this time I have entered the right password - 100% sure of that, and despite dozens of connect attempts it always said that login or password is incorrect! So I have retyped the exact same password and voila, after second connect attempt it worked.

Now. I know that there is SQL Server 2005 service pack comming out soon, but does anyone know if the login window will be fixed? Come on! Its only a UI with few imputs! How hard can it be?

Tuesday, February 06, 2007 11:29:32 AM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [2]  | 
 Wednesday, January 24, 2007

Today I have found a funny example of how to ensure the checkbox is not visible:

<input id="chkIsDirty" type="checkbox" readonly style="DISPLAY: none;
VISIBILITY: hidden; BACKGROUND-COLOR: transparent" size="0" runat="server"
name="chkIsDirty">

I have emphasized the important elements. I wonder if it is also hidden by the style sheets and maybe in the code via the runat="server" attribute :-)

Wednesday, January 24, 2007 3:23:10 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [3]  | 
 Thursday, December 21, 2006

I have found a post on Web Development Team's blog providing SOME information on what was changed/fixed with the new Service Pack. There is also another post on Scott Guthrie's blog on the same topic. Good!

But wait! Am I really expected to look all over the Internet and gather pieces of information just to build a list that SHOULD be available in a KNOWN and EASILY ACCESSIBLE location? You got to be kidding!

Thursday, December 21, 2006 8:33:04 AM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 

For some time now I have been having problems with "Connect To Server" window of Microsoft SQL Server Management Studio. The standard problem is that has problems remembering the password, or rather it has a habit of forgetting. The effect is that each time I run the MSSMS, there is a chance that my password will not be there even if I have checked the check box to remember it before. I'm currently running Windows 2003 Server, but I had exact the same problem on Windows XP.

Over a time I've got used to it and I no longer bother to check the "Remember Password" check box. Today however I have began to have a new suspicion.

Almost every time I try to log in to the server for the first time, I get a message that login or password was incorrect. I have always reentered my password thinking that I had made a typo. Some times it took me three times to get it right and that made me think.

Why is that window different? When I use the same password for other windows, my success/error rate is almost zero. Here I'm far from that. So I've investigated the issue.

The goal was simple: after entering a user name and password and getting a failed login attempt saying that the user name or password was incorrect, check if the message is right. Options were just to retry without changing anything or compare the entered text with what should be entered.

The first method was too easy :-). So I have decided to see what's in there. User name was a plain text so it was easy. And since it IS remembered, I have confirmed no error there. As for the password. I have used the Runtime Object Editor, to look under the hood. And guess what? Password was also correct!

Given the investigation I can say with certainty that there is a bug in the MS SMS! Such a simple function and it doesn't work!!! I have found one similar bug report. Not exactly the same but I think it is somehow connected. Imagine that. Big company, lots of money, lots of time, one small window and so many bugs!

kick it on DotNetKicks.com

Thursday, December 21, 2006 12:41:53 AM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [7]  | 
 Tuesday, December 19, 2006

Now I have a brand new Visual Studio 2005 Service Pack 1 installed. I'm happy with it, but I would be even more happy if I knew what was fixed by the installation. And so I went searching.

After a while, I just gave up! It is just to hard for me to accomplish the task of finding some kind of change log for the Service Pack 1! What I have found were Visual Studio 2005 Service Pack 1 release notes. On this page hidden in the summary section, just before a list of requirements and a very long list of installation issues, there it was, the link to What’s New in Visual Studio 2005 SP1. I have followed the link.

On the destination page one thing caught my attention - the topic: "What's New in Visual Studio 2005, This topic has been updated for Visual Studio 2005 SP1". Scrolling down a little, confirmed my suspicions. It is not a list of new features or bug fixes that were distributed with the new Service Pack 1. It is an overview of features the Visual Studio has now, after you install SP1. More Over! Look at the "New in Visual Studio 2005 SP1" section!!! Its empty.

I don't suppose that Microsoft is so evil not to provide some kind of change log. I only know that they just cannot make their own website usable and put the interesting things somewhere where people can actually find them. So, if anyone knows where can I get the list of features introduced with the new SP1 and the list of bug fixed, I would be grateful if he shares the knowledge.

kick it on DotNetKicks.com

Tuesday, December 19, 2006 7:52:33 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 

One more time Microsoft has proven that they just cannot do things right. This time it's all about the newly released Service Pack 1 for Visual Studio 2005.

I'm certain that most of the developers working with Visual Studio 2005 know about the fact that the Service Pack has just been released. If not, at least they are aware of the fact that Microsoft was planning to release the product for some time now. So now it has been released. Are you ready to install it? Try! I have tried and it was not an easy task!

When first I have read that it is available I didn't think long before I went to the www.microsoft.com site. There I have used the search function in hope ... I don't even know what I had hoped for, given my previous experiences with searching Microsoft's site using Microsoft's search engine. The search results were disappointing yet not surprising - couldn't find it:


I have even tried to exclude the "beta" word, but with no better effect:

So, as usual, when I need to find something on Microsoft's site, I used Google (!!!). No surprise here, first result - a hit:

Having the page I went downloading. After starting the download I was presented with a funny page telling me that people who have downloaded Visual Studio 2005 Service Pack 1 have also downloaded ... Visual Studio 2005 Service Pack 1. What a coincidence :-)

After few hours of download (it has 450MB) I could finally run the setup and wait for few hours (or so according to the information on Microsoft's page) until it installs .

I had the setup procedure up and running and. Oh no! They have worked too long on this product to just let it install in like that! After a couple of minutes of waiting I've been presented with an error message Error 1718 some file did not pass the digital signature check:

What's going on? I'm sure most of us don't bother to read the installation procedure on the download page, especially as it is presented below download button, after clicking which you are redirected to another page, but there there is an information that such a problem may occur. Unfortunately, until you try installing SP1 on your concrete system, you don't know if you need to follow the procedure and by that time you have already lost a dozen of minutes. After pressing OK - the only available option, the Setup Procedure went through the same steps as before - i.e.: I had to agree to the same license terms etc. This time though it took more than ten times the amount of time just to inform me about the same problem once more!

After following the procedure I was finally able to install the service pack, after wasting a lot of time on it.

BTW: Since I haven't changed anything in my default Windows 2003 installation it seams to me that many people will have the same problem with the new Service Pack as I had!
If I count the time I have spent on trying to install the Service Pack and multiply this by the number of people that might have the problem I get a rather big number. Who is responsible? (Again! Last time it was because of IE7 that many people lost a lot of time because of the problems installing it and yet more (all) suffered from incredibly long installation time not to count few restarts and 2 validations during the process).

The question remains: why Microsoft, given all its resources, can't make it right the first time? (or second for that matter). Why they have to have everything so tightly integrated in to the operating system (like IE)? It is like if I had a house and my TV was integrated with it!

kick it on DotNetKicks.com

Tuesday, December 19, 2006 7:39:58 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [3]  | 
 Thursday, December 07, 2006

In my recent article on Immediate Window, I have showed how you can use it to debug your application, but also how to run arbitrary code. Working with Immediate Window has one major drawback: it requires a lot of typing without any kind of support from the IDE. There is however an alternative way to call your methods using Visual Studio: Object Test Bench.

Object Test Bench as the name suggests is used to test objects. It has a simple visual interface that makes it easier to work with than with Immediate Window. For example if we have a class:

public class SomeType
{
  public string SomeMethod()
  {
    return "return value"
  }
}

Then we can add an instance of this class to the Object Test Bench, and execute any of its methods using context menu as on the picture below:

 

If method that is to be invoked requires parameters, Visual Studio will display a special dialog box where you can enter appropriate values - or select them from the list of other objects if necessary. Also, if the method has a return value, the result will be added to the Object Test Bench as a new object on which you can also invoke methods.

To use the Object Test Bench, go to the Class View (ctrl+shift+c), navigate to a class you want to test and from the context menu, select "Create Instance" or "Invoke Static Method" depending on what you are trying to test. You can also access the same functionality through the Class Designer (Class Diagram).

As good as the Object Test Bench may appear to be, there are also some major problems with it that in practice make it useless - at least for me.

The first and most serious problem that disqualifies the bench is the fact that any time you make a change in the code, the whole object structure is deleted from the bench. Just imagine spending couple of minutes setting objects up just to find out that one of the method requires changes. After you make the change, you have to set the whole bench from the beginning. Immediate Window does suffer from the same problem, but it is a lot easier to just run the same command sequence by pressing UP or DOWN arrows. You cannot do this in the Object Test Bench.

The second problem is that the Object Test Bench is only accessible through the Class Diagram - which I don't use and through the Class View - which I also don't use - I only work with Solution Explorer. It may not be big problem, but it requires an additional step to use the feature. Compare this to almost immediate access to Immediate Window and multiply by the number of times you use the feature.

Third problem is that you may not see the Object Test Bench at all! Some times it happens, that when you try to "Create Instance" of an object either through Class Diagram or Class View, there is no such function in the context menu! (BTW: Visual Studio is known to hide its features randomly). In my case the problem was that I had a Web Project selected as a startup project. Changing it to an class library solved the problem. Once again there is no such problem with Immediate Window.

So basically you can use both tools: the Immediate Window and the Object Test Bench. Both have their advantages and disadvantages, but I have found the Immediate Window to be just better, faster and always there and that is why I'm not using the bench any more.

kick it on DotNetKicks.com

Thursday, December 07, 2006 7:51:19 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 
 Tuesday, December 05, 2006

In one of my articles I have written about using Immediate Window for debugging purposes - how we can use this Window to debug an application without starting it. Basically you can use the Window, to start a debugging process on any of your methods just by invoking it in Immediate Window:

new MyNamespace.MyType().MyMethod()

or for static methods just

MyNamespace.MyType.MyMethod()

There are however other useful features that make this window even more powerful.

One of them is evaluation of commands. Take for example:

System.Guid.NewGuid()
{04653f8d-58d3-4254-adc8-fb6d95457b49}

Which presents you with a new Guid instance as a string. Nice feature to have since I'm no longer able to find the Generate Guid window in my Visual Studio 2005. This window was very useful when I was working with Visual Studio 2003.

The above is simply a static method call. Lets see what else can we do. The immediate window can be used as a simple (or very advanced when you think about it) calculator. Take for example:

5*5
25

What we get in return is... of course the result of this operation. Still this is also a method call underneath. We can go very far with this, as far as the .NET classes allows us to. If we need an advanced calculator we can use some of the Math's methods:

System.Math.Sqrt(4) + 3.2
5.2

Those are still only simple method calls. The interesting part begins with multi-line statements!

The immediate window allows commands to span multiple lines and include variables. With those you can do almost anything you could do in the normal code:

int x = 2;
2
int y = 3;
3
x + y
5

If you wonder how far you can go with Immediate Window, just consider this example:

System.Data.SqlClient.SqlConnection connection = new System.Data.SqlClient.SqlConnection("someconnectionstring");
System.Data.SqlClient.SqlCommand cmd = connection.CreateCommand();
cmd.CommandText = "SELECT * FROM SomeTable";
connection.Open();
System.Data.SqlClient.SqlDataReader reader = cmd.ExecuteReader();
reader.Read();
reader[0];

Not that you will use the window for such commands, but it is nice to know what it can really do :-)

BTW: I have noticed that sometimes Visual Studio hides the Immediate Window from me. While doing so it also removes the one place in the menu that I know of that can be used to show the window: Debug->Windows->Immediate. If your Visual Studio also knows better, the shortcut Ctrl+Alt+I will help you.

kick it on DotNetKicks.com

Tuesday, December 05, 2006 9:29:12 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [2]  | 
 Wednesday, November 01, 2006

There is a refactoring feature in Visual Studio 2005 that lets you generate method stubs for methods that don't exists yet. I have described this feature in my article on how implementing MembershipProvider can help to understand the Test Driven Development (TDD) rule of writing your tests first. Basicaly the feature I'm talking about generates a stub for a method and puts "throw new Excelption("The method or operation is not implemented.")".

As powerful and helpful as this feature is, there is a problem with it! It throws an Exception and not a more proper NotImplementedException as would be expected. We can change that!

The snippet responsible for generating method stubs is located in the Visual Studio installation folder. By default it is something like: "c:\Program Files\Microsoft Visual Studio 8\VC#\Snippets\1033\Refactoring\MethodStub.snippet". Changing the original value of:

 <Function>SimpleTypeName(global::System.Exception)</Function>

to

<Function>SimpleTypeName(global::System.NotImplementedException)</Function>

While searching for the solution to method stub problem I have also found that there is a "PropertyStub.snippet" file which should be used to generate property stubs. However I have been unable to find a way to invoke this snippet (it is not the same as "prop" snippet"). I have made a search on google and found some discussion on Microsoft's site that property stubs are not supported because it is hard to inferr something from their usage. Strangely enough there are tools such as Resharper that allow you to generate such stubs and why would there be a snippet file?

kick it on DotNetKicks.com

Wednesday, November 01, 2006 4:12:51 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 
 Thursday, October 19, 2006

Yep! Microsoft has done it again. They never fail at bringing you pain. This time it is the final release of their new browser - the Internet Explorer 7.

Since the beginning of my adventure with IE7 I have always had problems with it. At first I have paid two visits to my bank to change my online account password because for some reason i have been unable to log in with a message that the password was incorrect - thrid try and my account had been locked out. At first I thought that it is possible that I have forgotten it. The bank changed my password so I could log in again. But guess what? The new password which I have tested on the computer in the bank did not work at home! It took me a while to figure out that it was the new IE7 (BETA 1 I think) that was causing the problem! This was fixed.

Next there came the problems with "Navigation Cancelled" or other messages that prevent me from browsing sites. Strangely enough, refreshing such a page helps. Sometimes I had to refresh twice but mostly I can handle the problems.

Then came the final release! What a glorius day. I had a release candidate installed by the time I have downloaded the finall version, but I hoped that the setup procedure would handle this situation. This hope was against my previous experiences with Microsoft products which are generally hard to upgrade from the BETAs to finall releases. And then it came. The pain.

I have run the setup file. First validation of my copy of Windows - everything ok. (BTW: I was supprised that there was no validation before downloading). Then I've got a message telling me that I have to restart my system, because of the previous version has been installed. So I did. After a SECOND validation the installation procedure told me that it is downloading some updates for Internet Explorer 7. Hmmm. Updates already after few days? Ooo Ok.

Then the sceond restart came! What the hell? Two restarts are required to install a browser? Hmmm. Even Windows requires only ONE restart if I remember correctly.

After the restart I've been welcomed with a taksbar unlike my previous taksbar. IE7 has decided that I don't need my Quick Launch and my custom toolbar with shortcuts that I'm using for my software. Hmmm. So now IE knows better.

I'm afraid what else might be missing. One thing I have noticed is that IE also messed up my favourites toolbar...

Pain!

It maybe the time for

kick it on DotNetKicks.com

Thursday, October 19, 2006 9:31:51 AM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [4]  | 
 Thursday, October 05, 2006

So the Google Code Search has made it debut and everyone is happy. Searching for example code has never been easier. Is it all that the the search provides? Is C#, C++, PHP, Java and other languages code all there is? Someone found a WinZip Serial Number Algoritm, but there is one more thing you can do...

Every time there is a code there are comments. So maybe we should try searching for comments? Indeed this could be funny. Try some of the following searches and see the results :-)

The cite of the day: "/* This is crazy, but we are desparate at this point... */" :-)

I'm sure you can come out with more funny search ideas. I expect a wave of creative blog posts that exploit some of the funniest comments out there.

kick it on DotNetKicks.com

Thursday, October 05, 2006 8:53:07 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [1]  | 

Debuted just recently the new tool for programmers the Google Code Search is here.

Google Code Search

Maybe it will end the problem of documentation not having enough examples?

A sample search for a "foreach" construct in C# looks promissing.

kick it on DotNetKicks.com

Thursday, October 05, 2006 8:36:13 AM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 
 Wednesday, October 04, 2006

If you are developing n-tier application sooner or later you will find yourself in a situation where you need to move data between the tiers. Be it from the lowest tier - i.e.: the data tier or data access layer (DAL) to a middle tier such as business logic layer (BLL) or the other way around. So how to accomplish this task?

Actually there are many problems with moving data between tiers, especially if you like a clean OOP with a full domain model. Suppose you have a domain object filled with all the necessary methods such as a Teacher who can Grade Students. Now with this logic you also have the data such as Name for both the Sudent and the Teacher. That is your BLL. Now you also have a DAL in which you would like to have a method such as GetTeacherById or SaveStudent. What should those methods return (or accept as a parameter)? The easy answer is - your BLL objects. This implies the referrence from the DAL to BLL - which is wrong since most people will tell you that every layer should only reference the layer below. I agree with this recommendation completly. If you think about a situation where you would like to have some kind of lazy load mechanism for properties of your BLL objects or a simple method call that gets the data from the database such as Teacher.GetGradedStudents, you would have to have a referrence from BLL to DAL.

So is it possible to at the same time have a referrence from DAL to BLL and from BLL to DAL? In .NET it is not possible as long as both are in separate projects. This situation is called a Circular Refference and Visual Studio will not allow you to do it if you try.

So how to solve this issue? Surely there has to be a solution... There are many solutions to the problem. Microsoft has its way described in their article on Designing Data Tier Components and Passing Data Through Tiers. It is a good overview of the problem, but Microsoft being Micorosft has its way of thinking. After all they are the ones that promote the DataSet/DataTable objects.

In short: what you need is an additional component which I will call a Data Transfer Object (DTO). The DTO will be refferenced by both BLL and DAL but will not reference neither BLL nor DAL. This way we have no circular refference problem. The DTO objects will represent only the data, with no behavior. A DataSet/DataTable is an example of such an object. So is the DataReader or an XmlDocument. You can use any of the mentioned objects to move data from your DAL up to BLL, but it gets a little more difficult to do it the other way. More over, if you are not using Typed DataSets, how would you know how to access the name property of the Teacher object? By using an Indexer and a string argument to represent the column name? How do you know what columns are there in the database? Why do you need this knowledge in the BLL? You do not need it! Even more! It is a violation of the rule that the layer should only know about the layer immediatly below, but the database which dictates the column names is not directly below BLL it is below DAL. So not typed DataSets do not shield you from the database and that is why I think they are wrong. A better solution would be to use a strongly typed objects defined in a separate project. So for example there will be a Teacher class in the DTO with a Name property but without a Grade method.

As an example I have prepared a sample solution with 3 projects: BLL, DAL and DTO. You can download the sample here: DTOExample.zip (7.29 KB).

Keep in mind that the example presents only the simpliest scenario where BLL objects know about DAL and how to save themselves. In a real application it will most likely not be the case.

kick it on DotNetKicks.com

Wednesday, October 04, 2006 4:55:01 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [4]  | 
 Thursday, September 28, 2006

Today I happend to me for the n-th time! When I have tried to "Get Latest Version" on my solution I got the following message:

---------------------------
Microsoft Visual Studio
---------------------------
Unexpected error encountered. It is recommended that you restart the application as soon as possible.

Error: Unspecified error

File: vsee\lib\path\cvapipath.cpp

Line number: 2459

Of course we have done nothing unusual today. Adding some projects, changing some files etc. All this stuff made using Visual Studio 2005.

As I've mentioned this is not the first time it has happened to me so I thought I knew what to do. I have tried all the hacks that worked previously from deleting the solution file, through deleting the projects that I have found to be causing the problem to getting the files from the computer where it works. Unfortunatelly this time the "standard" procedure has not worked. Strangely enought I was able to commit changes made to the project that caused the problem.

I have been unable to find anything helpful on the internet other than the fact that I'm not alone with this issue.

As the last effort I thought I delete a ".suo" file for my solution. It was a desperate move but it worked! Wow! So basically now if you have any problems with Visual Studio that appear from nowhere, try the .suo file first :-)

As a side note: I have noticed that the new way ASP.NET projects i.e.: no project file, just directory, is a nightmare for source control tools. I have tried Subversion some time ago and the AnkhSVN plugin which in the newest version is said to support the Web Projects but I was a pain setting it up and it does work after all. What is worse is that even Microsoft's own products have problems with Web Projects! Since I remember I have always had problems with SourceSafe and ASP.NET. Be it ASP.NET 1.1 and Visual Studio 2003 or ASP.NET 2.0 and Visual Studio 2005 - always there are problems!

kick it on DotNetKicks.com

Thursday, September 28, 2006 10:56:40 AM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [4]  | 
 Monday, September 25, 2006

Today I have discovered that NUnit is distributed without one, thing that is VERY important - at least for me. The thing that is missing is the Xml Documentation for NUnit assemblies!

Since I needed it to work more efficiently, I have investigated the problem. It seams that neither the .zip nor the .msi file have Xml Documentation files included so I have downloaded the sources to see if there is any documentation at all in the code. Fortunatelly there is. Unfortunatelly none of the projects is set to generate the Xml Documentation file so I have changed that and compilled the solution. I ended up with a bunch of xml files that I have copied to the NUnit installation folder and since then I have a help like this:

Instead of just this:

I think that this issue has been reported to the NUnit team, but I'm not sure: here is what I have found in this matter. In the meanwhile feel free to use the files I have generated: NUnitXmlDocumentation.zip (50.17 KB) - compiled for NUnit 2.0 2.2.8

Installation is very simple, just copy the xml files to the directory where you have NUnit assemblies installed. Typically it will be something like: c:\Program Files\NUnit-Net-2.0 2.2.8\bin\.

kick it on DotNetKicks.com

Monday, September 25, 2006 12:49:20 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 

I have written an article on Visual Studio Code Snippets - how to use them, and how to create your own. I have provided there a couple of snippets that I use on daily basis. You can also check Mads Kristensen's blog where he provides a snippet for "safe events". Today I have thought of yet another useful snippet...

There often happens that you need to have some kind of property that does some calculation yet you do not want it to be a method. Maybe it is because of the ease of use or some other reason? But as far as best practice tells you, the property is expected not to perform any kind of lenghty operation. So in order to be able to make a property that does some time consuming task the result of which can be then quickly retrieved any time, you do a what is called a Lazy Loading or Lazy Initialization - one of the most useful patterns.

Suppose that we have a tree structure of some operations. Each operation is either an atomic operation or a composite operation consisting of sub operations - a simple composite pattern. Each atomic operation has a property that shows the number of arguments the operation requires to execute. So to count a total number of arguments required by the tree of operations you would have to recursively sum the number of parameters from all sub operations. And that is the operation that can take some time to perform given a large tree of operations. So there is a a choice of making exposing this functionality as a method or doing the Lazy Initialization.

If you go the "lazy" way, you will end up with something like this:

If using 2.0 version of the .NET Framework, you can do better and use the Nullable type for the field. And that is exactly the code snippet I provide. With it you can create such a lazy initialized property very quickly. Just type: "propn" and what you get is:

Just fille the green places.

I have added the snippet to my collection of Snippets.zip (2.23 KB). Feel free to use it.

kick it on DotNetKicks.com

Monday, September 25, 2006 10:39:09 AM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [2]  | 
 Saturday, September 23, 2006

Today I have played a bit with Microsoft's new command line tool called Windows PowerShell. Other names I have heard over the years include Microsoft Shell. The code name for the project was Monad. As usual, Microsoft cannot make it's mind and so, expect a lot of confusion. As a simple example: what would you expect the abbreviation for Windows PowerShell would be? WPS or PS maybe? But what when you install the tool, it has an icon like this: . If you look closely you will see the "MSH"...

Putting the naming inconsistency aside, I have decided to give it a try. It took few seconds to start for the first time, and I was presented with a message asking me if I want to run a software from untrusted publisher, which happens to be non other than Micorsoft Corporation:

Since this is one of my favourite companies, I just had to agree :-). It wasn't enough to agree just once ("[R] Run Once") because I was asked the same thing for a couple of times, so I have decided to trust MS always. Few seconds later, I had a command prompt ready.

The first impression is that it is very slow. The auto-completion function is slow, moving between directories is slow. But by slow I do not mean few seconds. I just mean it is slower than the plain old CMD. Fortunately, the slowness does not impact the usability of the tool, which brings you the power of .NET to the command line.

Just for a taste of how it works I have tried using some familiar objects and methods I know from programming in Visual Studio. So first off I called the ordinary "dir" command in the root folder of the C: drive and the output was more or less what would be expected:

Nothing unusual here. So where is the power of the PowerShell? The next command will say it all: "dir | foreach { $_.GetType().ToString() }" and the output for the same directory as above:

The command basically does some kind of operation: "GetType().ToString()" on each object thanks to the "foreach" command. As you can see, everything is an object in the PowerShell and as such you can execute methods on it or use it's properties. That is what I call Power Shell! Where are the linux shells hiding now :-)

As a side note. I really think Microsoft should do something to make the standard black window for the shell somewhat more usable - whatever that means. One feature that I would like the most would be the autocompletion of command parameters. I have seen this on one of the unix-like systems so it certainly is possible! Nevertheless PowerShell will rock even without it!

kick it on DotNetKicks.com

Saturday, September 23, 2006 1:56:22 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [1]  | 
 Friday, September 22, 2006

Have You ever wondered how you can add a link somewhere on your page, that will enable your users to submit your article to digg.com? It is rather easy to do it the simple way, by copying the digg link from digg.com, and putting it somewhere on your site for example as a hyperlink on some image. The digg url usually looks like this:

http://digg.com/programming/Microsoft_s_Unit_Testing_Framework_is_useles

Using it with image you get the following:

digg iconDigg This!

Most of the sites on the Internet currently provide you with the above. Is it perfect? I thought not, so I have searched for the better solution. What I wanted is to get the same digg link that is used on the digg.com. And after a while I have found few pages that explain how to do it. It's really easy. Just use the code below:

<div class="diggbutton">
<script type="text/javascript">
digg_url = 'http://digg.com/programming/Microsoft_s_Unit_Testing_Framework_is_useles';
</script>
<script type="text/javascript" src="http://digg.com/api/diggthis.js"></script>
</div>

And what you get is:

kick it on DotNetKicks.com

Friday, September 22, 2006 1:18:18 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [3]  | 
 Thursday, September 21, 2006

After almost two months I have decided to change the theme of my blog. The reason for this was simple: the previous theme was layed out using tables and that made it very difficult to make changes. Additionally I should now rank higher on Google since the structure of the documents is much cleaner. Time will tell.

Just for a reminder of how the blog looked like before:

Thursday, September 21, 2006 8:57:26 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [1]  | 
 Thursday, September 14, 2006

Every once in a while when I'm doing some WebServices I get to the point where I need to use the same class on both the server and a client. There are voices that say that you should not do it and that is against the idea of web services. In my opinion though it is not so! What I want to get is to use the same Data Transfer Object on both ends of the line. The reason for this is that I already have it defined in one place and there is no reason to define it once again IF I can reuse the implementation. Other clients - those that do not have the access to my classes may still use the definition from the WSDL language to generate their own classes - nothing is lost here.

The really good article explaining how and what you can do to make your life easier can be found here. A nice read and good to know stuff - really.

Now I wanted to give it a try. Unfortunatelly I was unable to deploy the solution to the PrivateAssemblies folder of the devenv.exe. I got an error when I tried add a web reference. Installing assemblies in the GAC helped.

Next step was to try to debug this stuff. This is actually pretty easy once you know the trick which is to use 2 instances of Visual Studio. One VS with the sources of the SchemaImporterExtension code and the other one which you will use to add web references. In the first one go to Debug->Attach To Process... menu item. Select Devenv.exe from the list (there should be one if you have only 2 visual studios) and attach to it. Now in the second Visual Studio you can add a web reference and... if you have a breakpoint somewhere in the first VS it should break the execution there. In the example file from the above mentioned site put a breakpoint on the line where you have: "public override string ImportSchemaType" and it should work :-).

You can debug almost anything in such a way - by attaching to the projects. What is not so obvious is that you can also attach to the Visual Studio itself. All you need is a second instance :-). This was pointed to me by some of the readers of my blog, when there was an issue of debugging ASP.NET BuildProviders.

kick it on DotNetKicks.com

Thursday, September 14, 2006 12:14:38 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 

Today I have encoutered a problem with debugging my web projects in Visual Studio 2005. The message was:

"Unable to start debugging on the web server. The server committed a protocol violation. Section=ResponseStatusLine".

I haven't changed anything in my software configuration since the beginning of the procject so I thought that something may be wrong with my IIS. I have searched the Internet for the error message and I have found the following article describing the problem. Basically it was Skype that made a conflict. I have done as the author suggests and it worked! Many thanks to Martin for investigating the issue. Just remember to start the IIS after changing options in Skype because it is now running (at least such was my case).

The strange thing is that I have allwasy have Skype running so why it conflicted today and not before? Strange...

 

Thursday, September 14, 2006 8:48:32 AM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 
 Monday, September 11, 2006

Today I have tried creating unit tests using the brand new stuff from Microsoft - their unit framework that comes with the Visual Studio Team Edition. Now that was a major disappointment. I wonder how Microsoft comes out with a crappy stuff like that all the time.

The problem I have encountered is that it is not possible to use inheritance in your test classes. Take for example a base abstract class in which you define tests for your objects hierarchy. One of the method is an abstract method which returns a concrete object and the other methods are test methods as in the example below:

public abstract class BaseTest
{
[
TestMethod]
public void ConstructorParameterShouldBeSaved()
{
Guid id = Guid.NewGuid();
BaseClass obj = CreateInstance(id);
Assert.AreEqual<Guid>(id, obj.Id);
}

protected abstract BaseClass CreateInstance(Guid id);

}

Now I create another test class that inherits from the BaseTest and provides an implementation for the abstract method. Nothing an NUnit framework cannot do. But guess what? It is not supported!!! The Visual Studio complains about the TestClass attribute defined on abstract class - error UTA003.

That defeats all my desire to use MS technology so I switched to NUnit.

kick it on DotNetKicks.com

Monday, September 11, 2006 9:53:38 AM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [8]  | 
 Wednesday, September 06, 2006

For a long time now I have been aware of this feature but still I think many users of Internet Explorer do not know about it. The feature that I'm talking about allows you to save a complete web page INCLUDING pictures to a single file so it can be used later without having to connect to the internet. This feature is accessible from the File->Save As... menu after you select the Web Archive (mht file) as a type of the saved file:

Note that there is also another option to save an entire page using the same dialog box and selecting Webpage, Complete option. This however creates one file for the page and a folder containing the rest of the required files such as images. This is not a very ellegant solution in my opinion.

As good as this feature is, there are occasionally problems with saving the page and the only information is that there was some kind of error (don't we love this kind of messages?). Other than that I think you will love it :-)

BTW: I haven't seen such a feature in the standard installation of the FireFox but I suppose that there is some plugin just for that.

Wednesday, September 06, 2006 9:41:13 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [1]  | 
 Wednesday, August 23, 2006

In my two previous article on relational database schemas I have described problems that arise when dealing with sql database schema that needs to be changed. I have also provided a quick tip on using Enterprise Manager to get the schema of your database. Those are the problems of relational world...

As described in the mentioned articles there are problems when it comes to keeping your database schema up to date etc. There are also problems when you need to keep the application code in sync with a database. Either you do a database-driven design and add fields in a database and then adjust the model to reflect this change, or you do a more model-driven design i.e.: the other way around - change the model and then adjust the database you always have the problem of synchronization. Tools are available that generate either a model or a database from eiher the database or the model, but is it perfect?

Far from it. One thing that I really appreciate when using Db4o is that I have no such problems. Simply because there is no database schema or in other words: the database schema reflects what I have in my model.

Now I'm not suggesting that object databases are the solution to all your problems. There are problems with data migration also however I haven't encountered one yet.

Wednesday, August 23, 2006 1:40:57 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [1]  | 

As promised in my article on upgrading database schemas, I will show you the trick that I have learned when I was preparing SQL database upgrade scripts for my databases (that is before I thought on using some automation such as SQL Delta).

The fastes way I have found to get the database schema from a Microsoft SQL Server 2000 is to use the Enterprise Manager. Just navigate to a database you want, select the Tables node and select the tables you want to get schema for (you can select multiple tables using either shift or control key). As an example I have selected two tables of MyGallery database:

Having selected the desired tables use the context menu and select Copy or use the ctrl+c shortcut. Now open some kind of text editor such as Notepad. Paste the content of a clipboard and what you get is something like:

Now that is very cool isn't it? I have used this technique fo comparing two databases some time ago. Just get the schemas from two databases, save them to files on your disk and use some text diff tool.

Far from perfect but if you have no tool this is what you got. One more thing to mention is that you can use this copy and past mechanism also with stored procedures.

kick it on DotNetKicks.com

Wednesday, August 23, 2006 1:28:01 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 

Every now and then there comes a time when you release a new version of you application. Some of the new versions do not require changes to the database schema, but there are times when such a change needs to be done.

So imagine that we have an application that several hundred of our customers run. The best possible situation is that all of them have the same version of a database schema. Then we do not have to test all the possible upgrade scenarios. Mostly however there will be multiple versions of databases that are out there and you have to handle all of them.

But what is really the problem you ask? We have developers that designed the database at some point in time, created an application that was sold with that particular schema version. Then, upgrades were made, between that version and the version that we are about to release now and developers have been told to create SQL upgrade scripts so that the we can ship them with a new version. All fine if developers were doing those upgrade scripts while changing the database. Worse if you have to make a diff of the initial database schema and the desired one. Either way it was, is and always will be prone to human error. People are error prone. We, developers make mistakes, especially when doing some mindless (most of the time) activities such as comparing databases.

So, how sure you are that the database upgrade scripts that you are about to ship are the right ones? Hard question. One thing you could do is to take an initial database, run the scripts and compare the schemas. I will post a short tip on how I do it with Microsoft SQL Server 2000 Enterprise Manager. If there are errors, correct them, run the scripts again, repeat until there are no differences (or you see none).

Another problem is that the schema is not the only thing that needs to be shipped. Imagine that there is some fixed data in your database that is constant. Imagine that this data need to be altered. Same solution exists as mentioned above. Do it by hand either at the end or incrementally.

Is this solution perfect? Is it cheap? Is it time and cost effective? When you think about it you will find out that there should be some automation available. And rightfully so. There are tools that let you compare the databases, point out the differences and even create an SQL upgrade script for you. Keeping in mind what was said earlier it should be obvious that such a tool is a must have tool in every software development company that does sometime upgrade its databases.

As mentioned, there are tools that help you automate this process. I have recently found the SQL Delta application that lets you do eliminate this time consuming and error prone process of manualy generating upgrade scripts. Now if I had such a tool back when I was wasting my time making the scripts instead of solving the real business problems...

kick it on DotNetKicks.com

Wednesday, August 23, 2006 1:05:41 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [1]  | 
 Friday, August 18, 2006

Today I have added a little "Add to del.icio.us" link at the bottom of each article. Feel free to use it :-).

Now the technical stuff. First of, for the blog engine I'm using ThinkJot. It is an ASP.NET 2.0 port of a popular dasBlog application. As any dasBlog user should know, the engine supports macros with which you can add some dynamic content to your posts. To use them you have to edit your template and use something like <%itemTitle%>. There are plenty of macros documented on the official dasBlog site and even more macros are supported that are not documented - or at least I haven't found the documentation.

So the procedure I went through while adding a del.icio.us link was a bit painful. First of when you google for an answer what you find is mostly far from perfect. Most sites just suggest adding a simple linkt to del.icio.us and provide some parameters in the url. What I have found on the del.icio.us site was far better.

The solution from del.icio.us by default uses javascript and a popup window for adding links and if javascript is not enabled it works just as a simple link.

The hard part was to integrate the solution with the dasBlog macros engine. I have found a dasBlogExtraMacros.aspx">ready made solution. I have needed something more customizable so I have not used it however. I have editted my itemTemplate.blogtemplate file by adding something like this below the item text:

<a href="http://del.icio.us/post" onclick="window.open('http://del.icio.us/post?v=4&noui&jump=close&url='+encodeURIComponent('<%permalinkUrl%>')+'&title='+encodeURIComponent('<%itemTitleText%>'), 'delicious','toolbar=no,width=700,height=400'); return false;"> Save This Page</a>

It is basicaly the script offered by del.icio.us but I have replaced the location.href with a standard permalinkUrl macro which I think is not documented. Secondly I have replaced the document.title part with itemTitleText - my own macro that returns current item's title as text. There is of course an itemTitle macro but it is an html anchor so it cannot be used (this can be changed in the config file, but since I want my article titles to be links I could not do it).

Creating the itemTitleText macro was very easy. All I had to do is add a property to an ItemMacros class as follows:

public virtual Control ItemTitleText
{
get
{
Control control;
string title = entry.Title;
if (requestPage.SiteConfig.ApplyContentFiltersToWeb)
{
control = new LiteralControl(Utils.FilterContent(entry.EntryId, title));
}
else
{
control = new LiteralControl(entry.Title);
}
return control;
}
}

That's it. I now have a del.icio.us link :-)

kick it on DotNetKicks.com

Friday, August 18, 2006 12:15:41 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [3]  | 
 Monday, August 07, 2006

So after two days of configuration and moving my articles from my old blog I finally have my new blog set up :-). I'm still to create my own template, but for now the standard one will have to suffice.

Monday, August 07, 2006 6:55:15 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [1]  | 

I haven't played with it a lot but but the most obvious was the far from complete support from the IDE. Given it is not a complete product I'm not blaming MS for it. What I blame MS for is the fact that installing LINQ is a destructive process i.e.: it damages some of the existing features of VS 2005.

For me the One thing that hurt the most was the fact that the refactoring SmartTags stopped working from a keyboard shortcut and that the Refactor option was missing from the context menu of the code window.

Since I could not imagine working without some useful shortcuts I started the process to recover the lost features. I've tried to reset the shortcuts from Tools-Options-General-Keyboard menu but it had no effect. Next I have tried to reset all settings using Tools-Import and Export Settings - no effect. Next there came Google.

I have found and that someone had a similar problem and there was a solution. Few posts from the top there is a 4 steps instruction (which didn't work for me) and than a 5th step which finally worked. I'm putting the stepps I have followed in for your convenience:

  1. Start up RegEdit.exe
  2. Open HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\Packages\{A066E284-DCAB-11D2-B551-00C04F68D4DB}\SatelliteDLL
  3. Edit the "Path" value and change it from "C:\Program Files\Microsoft Visual Studio 8\VC#\VCSPackages\1033\" to "C:\Program Files\Microsoft Visual Studio 8\VC#\VCSPackages\"
  4. Restart Visual Studio and see if these problems are fixed?
  5. Go to C:\Program Files\Microsoft Visual Studio 8\Common7\IDE and run devenv /setup followed by devenv /resetuserdata followed by devenv /resetsettings CSharp.

All this stuff makes me wonder. I have been using beta software since I have learned using computers but I cannot remember having this kind of problems. Maybe the betas I use are not as complicated as Microsoft products but hey! They are not developed by the army of developers!

kick it on DotNetKicks.com

Monday, August 07, 2006 10:12:55 AM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 

I have written few times about the little known features of variuos products etc. Today I will add one more to the list. There is a little known feature that web browsers have that can be very useful...

The feature I'm talking about is the possibility to execute simple (or even complex) Javascript code from the address bar. While reading this go ahead and type something like:

javascript: alert(2+2);

in your brwoser's address bar and hit enter. You will see a messagebox containing the result of the expression passed as the argument to the altert function. A simple calculator, but you can go and create more complex scripts such as scripts modifying some DOM elements.

Here is a script that I sometimes use to get the current DOM of the page - after it has been modified by any user actions/javascripts such as AJAX calls.

javascript: var x = window.open(); x.document.write(document.childNodes[1].innerHTML.replace(new RegExp(/</g), "&lt;").replace(new RegExp(/>/g), "&gt;"))

If the page you are trying to view does not have the DOCTYPE declaration just change the document.childNodes[1] to document.childNodes[0]. I have tested this with IE 6.0 and it seems to work well. For FireFox users there are a lots of plugins available to do the same thing.

kick it on DotNetKicks.com

Monday, August 07, 2006 10:10:05 AM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 

Sometimes you really need to debug some part of the application but you don't want to start it. For example you want to debug some lower layer of the application and the startup time takes too long. There is a quick solution for this problem. You can use the Immediate Window from Visual Studio to start a debug session. Just type a class name (with namespace) and a method name you want to call if it is static. Otherwise you have to add a call to constructor in a form of "new" keyword. Just remember to put a breakpoint somewhere :-)

As far as I know this window is not available by default so use Debug/Widnows/Immediate to show it.

The sad thing is that it does not work for an ASP.NET project, but other than that you can use it not only for testing your own methods, but to call methods of the built in classes such as System.DateTime.Now.

Monday, August 07, 2006 10:07:58 AM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [2]  | 

I'm not working with threads much since ASP.NET hides almost all of this complexity from me, but then I'm not working with ASP.NET exclusively. There are times when I need to do some multi-threading. In times like this I'm very happy that there are resources such as this available on the Internet. Currently It is the best article on threading I have seen. A good read.

Monday, August 07, 2006 10:07:22 AM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 

While working on one of the web projects in asp.net that was targeted for FireFox browser only I have found an interesting thing. Take a look at the memory consumption of a FireFox process:

Now, I wasn't doing anything unusual. Just testing how the site looks like in the browser. And I have only used 1 tab and only for this one application. Also the memory consumption got as high as 300mb in few hours. On my machine (1gb ram) FF stopped working around 500mb. So I think that is just one proof for all you FireFox lovers, that not only IE has problems :-P.

BTW: I have sat with one of the FireFox lovers from my company and tuned some caching options but it didn't help :-(.

Monday, August 07, 2006 9:57:58 AM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [3]  | 

From time to time a strange thing happens to my Visual Studio - a strange line appears on the screen in a random place and stays there until VS is restarted. It is only visible in VS, when switching to other programs it disappears. Switching between windows inside visual studio does not help.

This is just one of the hidden and secret features of the VS that most people don't know about. The other one, a more common one, is the fast disappearing feature which makes VS dissapear (self terminate devenv.exe process) at random when you are working.

Monday, August 07, 2006 9:52:51 AM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 

Yesterday I have found the post about the 0.(9) (zero, and infinite number of nines) equals 1. All of you weak at heart don't read it :-).

Monday, August 07, 2006 9:43:59 AM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 

Few days ago I have found some tool which I can honestly say is almost as good as the famous Reflector.

The tool is called RuntimeObjectEditor and does just that: it allows you to edit your applications at runtime. Amazing! You have to check it out!

Monday, August 07, 2006 9:41:23 AM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 
 Thursday, August 03, 2006

For all webmasters it is a bread and butter, but I have found that most ASP.NET developers are not very skilled the CSS stuff. The one thing that I often see is the lack of understanging for the position: absolute style. Many people think that what it does is positioning a given element absolutly on the page relatively to the whole page (the View Port). Mostly so, but that’s not the whole truth. By design, the position: absolute positions the elements in relation to the nearest Postioning Context. Of course by default the View Port is the nearest positioning context but this can be changed. By design, each element that is relatively or absolutely positioned becomes a Positioning Context.

One possible and often used way is to declare an element to be relatively postioned and not offsetting it so it remains in place. This way you can absolutly position elements in relation to any element you choose.

Thursday, August 03, 2006 4:34:29 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 

I have always wondered how practical if at all is writing the test first. Now, for me the most questionable thing was the fact that working in such a way I do not get any help from the editor. It came to me as a surprise that not only I do not miss the intellisense telling me what parameters I must pass to the method I’m about to call but I get a far more powerful feature instead...

I had already modeled the problem domain in classes. One of those classes was the User class. Now the time came to create a custom MembershipProvider that will integrate smothly with my classes. The classes of course were not created with the Membership feature in mind, so it was obvious that some methods will need to be implemented. I have started coding. At first I have created MyMembershipProvider and inherited it from the MembershipProvider class. Next I have moved to implementing each method. Suppose that I have started with nothing more than an empty User class declaration. The first method to implement on the MyMembershipProvider was the ChangePassword method. I have started typing:

Note that there are no methods to chose from, so I start typing the desired method name:

Once I get to the end Visual Studio detects that there is no such method defined on the User class and offers me an option to generate it (using the smart tag - ALT+SHIFT+F10). Of course I use the feature and what I get in the User class is a static GetUset method with two string parameters named after the variables I have used. The method also returns a user object. It also throws an Exception with message that the method is not implemented (I wonder why not the NotImplementedException). I have implemented the whole MyMembershipProvider in such a way and it went really smothly.

It is not hard to imagine what would happen if the place I first write the GetUser method is in fact a test method and the whole implementation of MembershipProvider is in fact a NUnit TestFixture. We would have a test-first written fragment of code which is what TDD is all about.

I strongly encourage everyone to try this approach. It is not only possible but it also leads to a much cleaner solution with only those methods that you really need and not the ones you think you will probably sometime use.

kick it on dotnetkicks.com

Thursday, August 03, 2006 4:26:16 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 

Recently I have argued with one of my fellow developers. On the topic was the point of validating input parameters for null values. The standard practice is for a null valued parameter (that we do not expect to be null) to throw some kind of exception: ArgumentNullException - most likely. But what if we don’t check the parameter and let the execution flow? It is possible that in the few instructions, the null reference exception will occur.

Now what is the difference between those two kinds of exception? Ultimately both signal that something went in an unexpected way. they both halt the execution of the code etc. Why bother?

There are numerous reasons why you should bother some of them include:

  • ArgumentNullException is way more meaningful when it comes to finding out the cause of the problem. For one, it allows you to specify the name of the parameter - something the automatically thrown NullReferenceException does not.
  • Throwing earlier saves both memory and processor time since if ultimately we are going to get the exception it is better to get it before executing some possibly time consuming sub-routine. Additionally it is easier to rollback since there is nothing to rollback :-).
  • It is easier to debug the code. It is just a single line where you throw “connection cannot be null”. Compare this to a line where there are multiple instructions invoked as it often happens and you wonder which one of the calls caused the exception.
  • What are you going to tell the author of the component if you happen to not have the stack trace for the exception - just message? That their component is not good :-P.
  • I personally believe that it is a shame then one of my methods throws a null reference exception.

In the extreme case, you could want to forget about exceptions altogether but what would you say if .NET Framework was written in such a way? You wouldn’t be happy yes?

As for the very good description of how you should handle exceptions I suggest reading the chapter on exceptions in Jeffrey Richter’s book.

kick it on dotnetkicks.com

Thursday, August 03, 2006 4:15:56 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [1]  | 

I have blogged about a working alternative to the ObjectDataSource control. One of the feature provided by my solution is the InternalSort mechanism. I will provide a short description here of how it works. The source code is packed together with my data source control (MyObjectDataSource.zip (30,43 KB)).

The SortUtility provides a generic capability to sort any collection of custom objects. It does so without changing the original collection. Internally it uses reflection to get the values of compared properties so in performance critical operations this utility should not be used. Otherwise it greatly simplifies development. Feel free to use it as you like and remember that feedback is always welcome.

Thursday, August 03, 2006 4:12:46 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 

The books that I would really recommend reading are:

ASP.NET and .NET Framework 1.1

An absoulte must read: either "Programming Microsoft ASP.NET" by Dino Esposito or "Essential ASP.NET With Examples in C#" by Fritz Onion. As a complementary read I would suggest reading "Developing Microsoft ASP.NET Server Controls and Components" by Nikhil Kothari and Vandana Datye. The last one gave me a very good insight on the life cycle of ASP.NET controls. It is especially valuable since there is currently no v2.0 edition :-(.
As for the basics of the .NET Framework, there are two books which you cannot live without and those are: "Programming Microsoft .NET" by Jeff Prosise and "Applied Microsoft .NET Framework Programming" by Jeffrey Richter in that order since the first one talks about all major features of the .NET Framework such as Windows Forms, ASP.NET, Remoting, Web Services and in doing so it does not go in to details. The other one details the inner plumbings of the .NET Framework describing the Intermediate Language, the Base Class Library. Especially good is the chapter on exception handling where the author talks a lot about best practices.

ASP.NET and .NET Framework 2.0

There are just few books I can recommend and those are: both Dino Esposito's books on ASP.NET: "Programming Microsoft ASP.NET 2.0 Core Reference" and "Programming Microsoft ASP.NET 2.0 Applications: Advanced Topics". The second of those books I have yet to read but knowing the previous works by Dino I'm pretty sure it will be a good one. The same is true for the "CLR via C#, Second Edition" by Jeffrey Richter which is a 2.0 version of his previously mentioned book.

While speaking about books there are of course other books than those dealing with computers. In this field I would strongly recommend reading the Dragonlance series - all books by Margaret Weiss and Tracy Hickman and the Wheel of Time series by Robert Jordan.

Thursday, August 03, 2006 2:41:05 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 

I need to write about few things:

  1. ObjectDataSource control and my own implementation. (with source and binary) - DONE
  2. My implementation of DataMapper.(with source and binary)
  3. My validation component. (with source and binary)
  4. BuildProvider for generating classes to enable developers to redirect to pages in a strongly typed way. - DONE
  5. Bug in the DataList control that causes properties set in ItemDataBound event to be not persisted on postback.
  6. Working with object graphs, ObjectDataSource and base detail page.
  7. Creating a class for handling Session variable access. - DONE
  8. Something about VirtualPathProvider.
  9. Why bother with exceptions if ultimately what you get is an error. - DONE
  10. Recommended books. - DONE
  11. Antipatterns on all levels.
  12. Custom ObjectDataSource select parameters. - DONE
  13. Working on a project using rich domain model with developers of various levels of experience.
  14. Pair programming in practice.
  15. Woring with Db4o in ASP.NET projects.
  16. ReturnUrl pattern. - DONE
  17. Conditionaly hiding a column in a GridView control - declarative way.
  18. Benefits of switching from PHP to ASP.NET
  19. Control.HasControls() instead of Controls.Count.
  20. Position Absolute - Positioning Context. - DONE
  21. When is the Select method of the DataSource control called? - DONE

Thursday, August 03, 2006 2:33:04 PM (Central European Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  |