Geoffroy’s Weblog

April 23, 2009

TFS and Visual Studio 2008

Filed under: Team Foundation Server, VisualStudio 2008 — gseive @ 11:32 pm

In order to do some branching / unit testing / building tests in isolation, I decided to do a complete install on a virtual machine using Microsoft Virtual PC 2007.

I had all the software from an MSDN license except for the key piece TFS 2008. Knowing my tests would be bound by this 90-day time period, I decided to go for the path of least resistance. As you will see from my list below, I don’t have everything “2008”!

Some of the things to note:

  • I kept an eye on the installation information from the install disk. It was open on my native machine (left monitor; right monitor dedicated to the virtual machine).
  • All the install disks were gathered in one folder as iso files.
  • I restricted myself to the User Administrator account whenever possible. When I had to I created a TFSAccount user member of Administrators group.
  • I did multiple Windows updates along the way to grab all existing updates.

I installed:

  • Windows Server 2003
  • SQL Server 2005 and the SQL Server SP2
  • Team Foundation Server 2008
  • Visual Studio Professional 2008 and the SP1
  • Visual Studio 2008 Team Explorer (downloaded it)
  • Team Foundation Sidekicks (for better access to TFS labels; but the tool has a bunch of other goodies)
  • Team Foundation Server Build
  • Microsoft TFS 2008 PowerTools (to monitor builds from the tray; a must have once continuous build is enabled)
  • AJAX extensions
  • ReShaper 4.5

April 13, 2009

Windows Power Toys / Tools

Filed under: Power Tools, Windows Server 2003 — gseive @ 11:54 pm

I’ve used the Power Toys for Windows XP for a while and was needing the “CMD Prompt Here” for Windows 2003.

I found the following blog post that was helpful: HOW-TO: Install XP Powertoys on Windows Server 2003.

And after reading the comments I actually downloaded the Windows Server 2003 Resource Kit Tools, located the cmdhere.inf file and installed it (right click / install). Done!

April 9, 2009

Starting with Oracle Developer Tools for Visual Studio

Filed under: Oracle Developer Tools for Visual Studio, VisualStudio 2008 — gseive @ 11:56 pm

Having to develop a new Oracle package I decided this was a good opportunity to start exploring the ODT add-on I had installed in Visual Studio 2008 a while back. I followed those steps:

  • Created an empty solution
  • Added an Oracle Database Project in Other Project Types (not to be confused with a Visual C# / Database / Oracle Project)
  • Watched the project being added to the solution with folders for all the different types of Oracle database objects
  • Added a new Package to the Packages folder
  • Replaced the code templates with my own code
  • Run the script to create the package
  • Refreshed the Server Explorer pane and watched my package being added to the packages node
  • Added the solution to the Source Control

Word of caution

After that initial setup I ran into the same issue I had run into with SQL Server 2005 last year.

In order to run or debug your package I have to be on the Server Explorer side and any changes made to the PL/SQL code will be saved to the database. I then need to copy and paste back to the Solution Explorer in order to check in those changes. Or I can only make the changes in the Solution Explorer, Run to commit the changes to the database and then go and test in the Server Explorer.

Either way this requires great discipline and is prone to mistakes. Things got “worse” when I tried using another PL/SQL editor (like Oracle SQL Developer or PLSQL Developer) because of the greater context switching and the increased chances of forgetting to copy back to Visual Studio and committing to TFS. I don’t know of an ideal single-step solution yet.

I’ve started using a simpler approach based on the option in Server Explorer called “Generate Create Script to Project…”.  Using that approach both the specification and the body have to be generated separately. Also, each time a new file is generated it overrides the previous one in the Visual Studio project.

The code editor itself needs some polish. For instance it doesn’t have the code completion that Oracle SQL Developer has. The code collapsing partially works. Stored procedure and function names don’t always appear in the drop-down list above the code editor pane.

March 13, 2009

Installing Windows 7 on Microsoft Virtual PC 2007

Filed under: Microsoft Virtual PC 2007, Windows 7 — gseive @ 2:53 pm

A month ago I had installed Microsoft Virtual PC 2007 on a Windows XP SP3 machine to test Windows Server 2008. I thought I could use it too to install Windows 7 Beta. The install was fast and smooth. I then installed the Virtual Machine Additions and when the virtual machine rebooted I got the blue screen of death on startup! I tried a couple things without success and then googled the issue and found a helpful post from Scott Cate. Guess what? There is an SP1 for Virtual PC 2007! The installer will remind you to make sure that none of your virtual machines are in a saved state. Sounds like the consequences could be bad… I didn’t take the time to go and explore that!

005

I went through the install process again (Windows 7 + VMA) and everything went fine this time.

February 25, 2009

Zip and Unzip Files with ZipGenius

Filed under: C#, Compression, System.Diagnostics.Process, Zip — gseive @ 12:12 am

Once, I had to uncompress a tar file and looking around I found this great utility, ZipGenius. It works great and it’s free!

It can also be run from the command line which mean it can be encapsulated in a batch file or even better, if  you need more programmatic control, it can be embedded in a .NET program.

For the details of the command line options go to: http://zipgenius.altervista.org/zg6/eng_zghlp/.

Here is an example of some C# code calling ZipGenius with System.Diagnostics.Process.Start:

using System;
using System.Collections.Generic;

namespace ZipGeniusProject
    // more information on the command line options at
    // http://zipgenius.altervista.org/zg6/eng_zghlp/
{
    class ZipGenius
    {
        static void Main(string[] args)
        {
            List<string> commandPieces = new List<string>();
            string command = @"""c:\Program Files\ZipGenius 6\zg.exe""";
            commandPieces.Add(" -add ");
            commandPieces.Add(@"""C:\My Folder\Test.zip""");
            commandPieces.Add(" C5 K0 +");
            commandPieces.Add(@"""C:\Drivers\C600\BIOS\*.*""");
            string zgArgs = String.Concat(commandPieces.ToArray());
            System.Diagnostics.Process.Start(command, zgArgs);

            // Another option is to use a batch file.
            // It's simpler but offers less programatic flexibility.
            // System.Diagnostics.Process.Start(@"c:\myscript.bat");
        }
    }
}

February 18, 2009

Accessing Oracle 11g from .NET

Filed under: Oracle 11g and .NET — gseive @ 3:14 pm

Working on a new project that uses Oracle, I installed on my machine:

  • Oracle 11g express
  • Oracle SQL Developer
  • Oracle Developer Tools for Visual Studio.

 Then I got stuck when trying to access my newly created table from an ASP.NET page.

Thanks to a blog post from ecocoma I was able to fix what was missing in my configuration and I was back in business!

What I needed was the following two adjustments:

  • Set environment variable Oracle_Home to C:\app\<network_id>\product\11.1.0\client_1 (I didn’t change the default directories during the install of 11g).
  • Copied the two files sqlnet.ora and tnsnames.ora from C:\app\<network_id>\product\11.1.0\db_1\NETWORK\ADMIN to C:\app\<network_id>\product\11.1.0\client_1\Network\Admin.

From there going through the article Build a .NET Application on the Oracle Database with Visual Studio 2005 or 2008 was the usual .NET development.

January 30, 2009

Acceptance Testing and FitNesse .NET

Filed under: Acceptance Testing, FitNesse, Unit Testing — gseive @ 10:49 pm

I’ve had to dig into FitNesse lately. Here are some resources that have helped me get up to speed.

January 24, 2009

Adding page numbers to pdf documents

Filed under: Lisp, pdf — gseive @ 12:08 am

I’ve been dealing with a couple Microsoft documents for quite a while. Both in pdf format and both without page numbers! The larger one has almost 500 pages. You can easily imagine the nightmare if you drop the printout!

I recently found a couple solutions to this irritating problem.

The first one is based on a small Windows application called PDF Page Number from BureauSoft. It’s free to try. It’s easy to use and it works. At last I had numbers on my pages!

The second one is a lot more specialized in the sense that it’s based on a Lisp library and would require extensive knowledge in that domain of computer programming. Michael Weber on his blog shows how to remove and then add page numbers (he had to assemble several pdf documents together first). It’s apparently based on Common Lisp and it would be really cool if somebody had written a tutorial on how to set up the environment and get Michael’s code to run.

 

Hope that helps!

October 15, 2008

Can you register more than one postback method with an event of the PageRequestManager?

Filed under: AJAX, JavaScript — gseive @ 6:02 pm

 

For the past 10 months I worked on a project using ASP.NET AJAX and the server-centric development model with ScriptManager, UpdatePanel and PageRequestManager.

 

Something I have not read about, but that was actually fairly easy to verify, is “can you register more than one postback method with an event of the PageRequestManager?”.

So I modified the code of a really simple, yet interesting, example that shows how to use the initializeRequest event to allow an asynchronous postback to be canceled. It comes from MSDN at the page for the Sys.WebForms.InitializeRequestEventArgs Class.

Here’s the code I added:

                Sys.WebForms.PageRequestManager.getInstance().add_initializeRequest(AddMyMessage);

and

                function AddMyMessage(sender, args)

                {

                    var aspan = $get(messageElement);

                    aspan.innerHTML = aspan.innerHTML + ” it works!”;

                }

 

As you will observe the answer is yes, it can be done.

 

A good read in Partial-Page Rendering Overview is Working with PageRequestManager Events.

 

A more complete example can be found at Canceling an Asynchronous Postback.

 

Some good background information can be found in the section UpdatePanel Control Overview. The AJAX Server Controls section it is a part of also introduces the ScriptManager control, the Timer control and the UpdateProgress control.

 

 

Unfortunately some examples are not coded properly.

 

 

Another good source of information is the book ”ASP.NET AJAX in Action”. I found it informative and well organized, covering very well all the different aspects of ASP.NET AJAX.

ASP.NET AJAX in Action

  

Hope that helps.

February 29, 2008

Accessing Global and Local Resources

Filed under: External Resources — gseive @ 4:02 am

I had externalized some error messages to Global.resx. So I was looking at accessing them from my code behind and wasn’t sure about the syntax. Influenced by the syntax used in an ASPX page – <%$ Resources:Global, SomeResourceName %> – I impulsively tried the following: Resources.Global. And sure enough that did it! Quite amazingly I had not had an opportunity to use it until now and I have to say it’s really cool to have Intellisense kick in. Less typing and less typos! It only comforts me in the opinion that all user-related strings should be externalized and resx files should be managed by business analysts. This becomes strikingly necessary when the site has to be in two or more languages.

Some useful resources:

How to: Retrieve Resource Values Programmatically

How to: Use Resources to Set Property Values in Web Server Controls

How to: Create Resource Files for ASP.NET Web Sites (Visual Studio)

Older Posts »

Blog at WordPress.com.