in

ASP.NET Weblogs

Russell Pooley's .NET Blog

.NET Tools, Source and Research

July 2003 - Posts

  • Designer Hosts in .NET

    I have just seen a nice sample at the WindowsForms web site using DesignerHosts to create the Windows Forms editor in Visual Studio .NET

    Nice.

    Had to update the link as Microsoft has removed the project from its content, here is the direct link: Designer Hosts, by the way this site has some other interesting articles.

  • VB.NET enterprise development whims and code conversion

    If anyone is attempting to create an enterprise system in VB.NET, or thinking about, then let me tell you this, DON'T. After creating an enterprise project consisting of over 1000 classes, VB.NET is beginning to look a little weak Now you may ask whats the problem with VB.NET or may come to the conclusion that I'm one of those developers that are anti VB, well I'm not. I like VB and C#, they both have there strengths and weaknesses but when it comes to enterprise development I believe Microsoft made a big mistake with the IDE for VB.

    The biggest problem with using VB for large projects is the IDE insists on checking your code for any errors as you type (Background code compilation), now this is great for checking for errors before compile time but the problems come when your projects reach a significant size for the background compilation to gradually slow down your productivity. We have a core data access layer which I believe is quite complex and if we wish to add a new method to any class within the project it will take approximately 30 seconds for the cursor to allow any typing after pressing the return key.

    Now I must say I wasn't happy with this so I contacted Microsoft regarding the problem through my MSDN account, they acknowledged it as a bug and I therefore assumed that it would be fixed in Visual Studio .NET 2003 (Everett), after receiving the CD's for the Everett beta I tried the same projects on that. Admittedly it was quicker, but it was still as far as I was concerned too slow, Microsoft logged this same problem as a bug on Everett and after speaking to Microsoft again they said the problem with the background compilation was too deep rooted into the IDE that the possibility of being able to switch it off would not be possible, so the bug still stands in the release of Visual Studio .NET 2003.

    Now my day consists of avoiding my VB.NET projects like the plague, I was unhappy, I wanted C# code. Easy I'll just convert it!!!!!!

    So my journey began to look into VB.NET to C# code converters and I ended up building a resource of links that I thought would be of some use, they weren’t to me since the majority of the tools that were freely available didn't seem to perform particularly well. I found two commercial applications that claimed to convert the code and since trial versions weren't available it was quite hard to tell what they will do until I stumbled upon a Japanese web site that claimed to have a VB.NET to C# converter for free, called strangely enough VBCS (the same name as the commercial application produced by www.immunicode.com ).

    After downloading and running the converter, which currently is at version 1.1 it became obvious the application was built for the Japanese as there are no English instructions for it, and the user interface is for a Japanese culture but it is pretty simple to use.

    Does it work? This was my biggest test and surprisingly it does very well, it’s probably the best converter I have seen so far and I will be using it for converting any of my VB code to C#, so my tip for today is if you need to convert VB.NET code then check this tool out as it really does work and its free.

    Japanese free VBCS
    ImmuniCode VBCS
    CodeProject GBVB

  • Visual Basic .NET Resource Issue

    Having written a number of windows forms in Visual Basic and regretting the fact I never used C# a number of problems started to arise.

    When running the application that used some of my classes I kept receiving a MissingManifestResourceException when attempting to show the form. This didn't make to much sense to me since the code behind the form hadn't actually changed, other than some new type declarations.

    I began looking around the web for an answer and happened to hit upon the following knowledge base article: Q318603

    The problem turned out that if you place a type declaration before your form class in VB.NET the VB Compiler will ignore the namespace of the form when compiling the resources, thus when the form loads it cannot resolve the resources and throws an exception.

    Supposedly this also effects C# but I haven't tried yet.

  • Retrieving System Directory Info

    Iv'e just spent the last hour or so looking around for how I can get the path of a system directory inside windows, for example the Start Menu folder.

    After seeing many different methods of getting the path I'm sure I'd seen something in the framework that would do this for me and yes there is, so for everyone who doesn't know you can use the:

    System.Environment.GetFolderPath(SpecialFolderEnum folder).

    Very handy, my only question now is how I can get the path for All Users and not just the user who is logged on. ohh well best keep looking.

    After browing for a little longer to get the path of the All Users Profile in windows use :

    System.Environment.GetEnvironmentVariable("ALLUSERSPROFILE")

  • Aspect Oriented Programming (AOP)

    Iv'e just stumbled upon some nice resources for Aspect Oriented Programming.
    How many times have you had to write code that logs messages to a text file or database, using AOP techniques it is possible to decorate your .NET classes with attributes that will then automatically log all requests made to methods and functions.

    Over the next few days I will be looking at how this all works. Some useful info can be found at the following sites: C# Corner (Aspect Oriented Programming), MSDN Article on AOP.

    I have yet to find out what kind of performance hit the use of ContextBoundObject makes to classes generated in .NET, but I'm sure I will soon find out soon.

  • Object Oriented Database

    Having been involved in developing many RDBMS based applications over the years, I was quite interested in researching into Object Oriented Databases and happened to stumble upon Perst.

    I must say I was quite impressed, and hopefully the future of databases will follow this kind of example in the future. Another bonus is the fact the source code is also provided.

    Lets hope that the new Sql Server(Yukon) has some object oriented features to aid in future .NET database applications.

More Posts