Team Foundation Server on Server 2008

6. November 2009

Installing Team Foundation Server on 2008 is a bit tricky. Here are a couple of notes to take into account before you install. This post is really just an archive for me, but if they are useful to people, yay! These are some of the issues I ran into:

SLIPSTREAM SERVICE PACK 1

I went to install Team Foundation Server and I got some random errors about inability to connect with Reporting Services.

 

Team Foundation Server could not connect to the SQL Reporting Services WMI provider.  Verify that SQL Reporting Services is installed and running. 

 

This was actually due to the fact that Team Foundation Server doesn't work with SQL Server 2008 without Service Pack 1 slipstreamed. http://www.woodwardweb.com/vsts/creating_a_tfs.html contains a good way to do it.

SQL Reporting Services on the TFS Machine

Apparently although Reporting Services uses web service TFS must have reporting services configured on the machine you install TFS on (Application Tier). 



Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

We're on to you!

9. October 2009

Hey, get back to work!

 



There is also a direct link for those who want to re-route corporate dns.

backtowork.cyberkruz.com



Currently rated 5.0 by 2 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Get into Java Part 1: Hello World

27. July 2009

Forward
Two years ago I developed a number of Java applications. Since then I have been developing exclusively in .Net. I just got a project requiring Java development, and it occurred to me that my Java skills are lacking since my Java prime. This is a series of tutorials designed as a refresher course.

Overview
The intention is to remove the base concepts of object oriented programming and patterns bringing how to develop in the language forward. It is designed for previous developers of Java and advanced developers in other languages trying to jump into Java.

Tools
At the time of this writing Java 6 revision 14 JRE is out. For those that don’t know the Java Runtime Environment (JRE) runs on your machine and executes Java applications. The Java Development Kit (JDK) is the development tools for writing Java applications. Eclipse is the primary IDE for Java and will contain the JDK.

 

Hello World
I’m going to assume you are using eclipse for now. If you would like to compile projects by hand the javac application in the jdk is how you would go about it. Lets get started.

  • Launch eclipse
  • Click File->New Java Project
  • Project Name: HelloWorld
  • Click Finish

 

This created your application’s directory structure. Now we want to add the actual HelloWorld class.

  • Click on the arrow next to HelloWorld in the Package Explorer to open the directory tree.
  • Right click on src
  • Click New->Class
  • Under Package, enter com.cyberkruz
  • Under Name, enter HelloWorld
  • Under “Which method stubs would you like to create?” check “public static void main(String[] args)”
  • Click Finish

 

Change your code to the following

package com.cyberkruz;

public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello World");
    }
}

Up at the top there is a green button with an arrow, click it and your Console (down below) should say “Hello World.” Success!

Explanation

  • package – Defines that the application is located in the com.cyberkruz package. This is used for sorting your code. It is basically the same as a namespace in .Net (I know there are differences, don’t flame me). When the code is organized, it is placed in the corresponding folder structure according to the package.
  • class – The basis for oop. Not going into oop this is how you define a class in Java. The public keyword defines the access level. Here are the access levels:
    • public – class, package, subclass, world
    • protected – class, package, subclass
    • no modifier – class, package
    • private – class
  • static – The static keyword denotes that the method isn’t called from an instance of the class.

 

So we defined a package com.cyberkruz. We added a class to the package that is visible to the world. We added a method taking in a string array of arguments that can be passed from command line. We then accessed the System.out class and the println method which prints a string to the command line.

I realize this is incomplete. The intention is to refresh memory and help people jump into Java code without a lot of hassle. More tutorials in this series will be posted soon.



Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Java

IIS7 FTP Issues

27. June 2009

I was installing IIS7 FTP on a server, and I ran into a couple of problems connecting with FileZilla. I am really posting this for archive purposes, but perhaps someone will get some use out of it.

I used the following articles to set up my ftp:


After those installations, I ran into these issues:

530 Valid Hostname is expected
I first encountered this. I found that when you log in by default, the site name is normal (ex: ftp.whatever.com), but the username should be site|username (ex: ftp.whatever.com|myUser). The reasoning behind all of it resides in the link; IIS7 wants full hostname in with the username to discern the site to use.

150 Opening BINARY mode data connection failure
This was the second issue I ran into. I found out pretty quickly that it is because of the Windows Firewall, but it took a while to find the command to open the dynamic port range.

netsh advfirewall set global StatefulFtp enable

I ran that command which tells the Windows Firewall to open up dynamic ports as needed. It all worked great from there. Note: I first opened port 21 for general ftp.



Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

IIS7 , ,

Building ClickOnce with CruiseControl.Net

14. May 2009

I was configuring automated builds with CruiseControl.Net which went relatively good until publishing ClickOnce applications. Since I didn’t have Visual Studio installed on the development machine, I was getting the error:

error MSB3147: Could not find required file 'setup.bin' in 'ProjectFolder\Engine'

After searching for the answer for hours online, this article showed me the solution. It was in with some other office building stuff, so I am going to highlight the actual ClickOnce steps.

  1. Copy the bootstrapper files from Visual Studio to the same directory on the build server ‘Program Files\Microsoft SDKs\Windows\v6.0a\Bootstrapper’
  2. Create a registry setting to point to the location:
    Key: HKEY_LOCAL_MACHINE\Software\Microsoft\GenericBootstrapper\3.5\
    Value: Path
    Type: REG_SZ
    Data: C:\Program Files\Microsoft SDKs\Windows\v6.0a\Bootstrapper\

 

Hope this helps. Thank you Rinat Abdullin for the solution.



Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

CruiseControl.Net ,

Silverlight Zooming and Panning a Canvas

12. May 2009

Zooming and Panning seems to be in great demand for Silverlight projects. I myself searched around through numerous articles trying to figure out good ways to do it. I came up with a solution that hopefully can satisfy some of the demand here on the internets.

First thing I did was make a control that is the zooming and panning canvas. I called it DesignRender as it applied to the particular project I was developing.

<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    x:Class="SilverlightApplication2.DesignRender">
    
    <ScrollViewer x:Name="scrollRoot" VerticalScrollBarVisibility="Disabled" 
                  HorizontalScrollBarVisibility="Disabled">
        <Canvas x:Name="canvasRoot">
            <Canvas Background="#FF00FBF2" x:Name="canvasContainer"
                    Width="1000" Height="800">
                <!-- This is dummy stuff for zooming/panning -->
                <Rectangle Width="90" Height="90" Fill="#FFCA1F1F"
                           Canvas.Left="0" Canvas.Top="0" 
                           RadiusX="2" RadiusY="2" />
                <Canvas.RenderTransform>
                    <ScaleTransform x:Name="scaler" 
                                    CenterX="0" CenterY="0" 
                                    ScaleX="1" ScaleY="1" />
                </Canvas.RenderTransform>
            </Canvas>
        </Canvas>
    </ScrollViewer>
</UserControl>

I am using a scrollviewer so I can place the UserControl effectively in a parent control. You can change this as desired. The canvasRoot acts as your background and the canvasContainer is the actual content residing in your background. If this was photoshop, the canvasRoot would be the greyed out background and the canvasContainer would be your actual document. Hence the static sizing of the canvasContainer. Now for the code behind.

public partial class DesignRender : UserControl
{
    private bool isDragging = false;
    private Point offset;
    
    public DesignRender()
    {
        InitializeComponent();

        // Handle the mouse click events within the control
        // for panning.
        this.canvasContainer.MouseLeftButtonUp += 
            new MouseButtonEventHandler(canvasContainer_MouseLeftButtonUp);
        this.canvasContainer.MouseLeftButtonDown +=
            new MouseButtonEventHandler(canvasContainer_MouseLeftButtonDown);
        this.canvasContainer.MouseMove += 
            new MouseEventHandler(canvasContainer_MouseMove);
        
        // Handle the scroll wheel events. They are different
        // per browser so we have to attach to a couple of events.     
        HtmlPage.Window.AttachEvent("DOMMouseScroll", OnMouseWheel);
        HtmlPage.Window.AttachEvent("onmousewheel", OnMouseWheel);
        HtmlPage.Document.AttachEvent("onmousewheel", OnMouseWheel);
    }

    /// <summary>
    /// Called when the mouse wheel is used. Zooms
    /// in our out depending.
    /// </summary>
    private void OnMouseWheel(object sender, HtmlEventArgs e)
    {
        double mouseDelta = 0;
        ScriptObject obj = e.EventObject;
        
        // Get what the mouseDelta was in
        // the particular browser being used
        if (obj.GetProperty("detail") != null)
            mouseDelta = ((double)obj.GetProperty("detail"));
        else if (obj.GetProperty("wheelDelta") != null)
            mouseDelta = ((double)obj.GetProperty("wheelDelta"));
        
        // Quick mouse translation
        mouseDelta = Math.Sign(mouseDelta);

        // calculate the new scale for the canvas
        double newScale = this.scaler.ScaleX + (mouseDelta * .25);

        // Don't allow scrolling too big or small
        if (newScale < 0.25)
            return;
        if (newScale > 10)
            return;

        // Set the zoom!
        this.scaler.ScaleX = newScale;
        this.scaler.ScaleY = newScale;
    }
    
    /// <summary>
    /// Called when user presses mouse down. Start
    /// panning.
    /// </summary>
    private void canvasContainer_MouseLeftButtonDown(
        object sender, MouseButtonEventArgs e)
    {
        // Say we are dragging
        this.isDragging = true;
        this.canvasContainer.CaptureMouse();
        // Calculate the place where they clicked
        offset = e.GetPosition(this.canvasContainer);
        offset.X *= this.scaler.ScaleX;offset.Y *= this.scaler.ScaleY;
    }
    
    /// <summary>
    /// Called when user releases mouse. End panning
    /// </summary>
    private void canvasContainer_MouseLeftButtonUp(
        object sender, MouseButtonEventArgs e)
    {
        if (this.isDragging)
        {
            // Say we are done dragging
            this.isDragging = false;
            this.canvasContainer.ReleaseMouseCapture();
        }
    }
    
    /// <summary>
    /// Called when the user moves there mouse. If
    /// they have the mouse button pressed then we
    /// pan.
    /// </summary>
    private void canvasContainer_MouseMove(
        object sender, MouseEventArgs e)
    {
        if (this.isDragging)
        {
            // Calculate the new drag distance
            Point newPosition = e.GetPosition(this.canvasRoot);
            Point newPoint = 
                new Point(newPosition.X - offset.X,newPosition.Y - offset.Y);
            
            // Set the values
            this.canvasContainer.SetValue(Canvas.LeftProperty,newPoint.X);
            this.canvasContainer.SetValue(Canvas.TopProperty,newPoint.Y);
        }
    }
}

The code itself should be pretty self explanatory. I use scaling to do the zooming and mouse down events for panning. Now just host this control in your Page.xaml whatever way you would like. This should get everyone started in the right direction. Hope this helps.



Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

C#, Silverlight , , ,

Error performing inpage operation

2. May 2009

I have an external harddrive to which I thought I lost all of the information on. Whenever I plugged it in, the light would come on like it was going to read and then turn back off again. Whenever I tried to access the volume, I would get an error message saying “Error performing inpage operation.” After looking extensively online, I ran

chkdsk l: /f 
substitute l: for your volume label

It repaired the drive and works great. Off to buy another terabyte hdd for backups. Hope this can be useful for someone.



Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Serializing and Deserializing XML to files

7. April 2009

This is a simple class for serializing a type to a file and deserializing a type from a file. This code shouldn’t be considered production, but it will show you a very simple way to do it.

    /// <summary>
    /// Class for saving xml serializable types 
    /// to a file.
    /// </summary>
    /// <typeparam name="T">The generic serializable
    /// type that is going to be serialized or deserialized</typeparam>
    public class TypeSerializer<T>
    {
        /// <summary>
        /// Serializes and saves the specified item
        /// to a file specified.
        /// </summary>
        /// <param name="item">The item to serialize.</param>
        /// <param name="path">The path to the file.</param>
        public void Save(T item, string path)
        {
            // Create the serializer
            XmlSerializer s = new XmlSerializer(typeof(T));
            // Create the writer
            TextWriter w = new StreamWriter(path);
            // Do the work
            s.Serialize(w, item);
            // Clean up
            w.Close();
        }

        /// <summary>
        /// Loads the specified file and serializes it.
        /// </summary>
        /// <param name="path">The path to the item.</param>
        /// <returns>The serialized type.</returns>
        public T Load(string path)
        {
            // Create the serializer
            XmlSerializer s = new XmlSerializer(typeof(T));
            // The item we are returning
            T item;
            // The text reader that puts the text in the stream
            TextReader r = new StreamReader(path);
            // Deserialize the item and cast it
            item = (T)s.Deserialize(r);
            // Clean up
            r.Close();
            // return the item
            return item;
        }
    }
Simple to use. Just call new TypeSerializer<YourClass>().Save(item, path); to save it or TypeSerializer<YourClass>().Load(path); to load it. Thank you CodeProjectfor the step in the right direction. I just wanted a simpler example to start people out. I hope this helps.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

C# , ,

Excel Importer

17. March 2009

I wrote this little WPF application as the demonstration for my previous article on reading excel spreadsheets. I figured everyone should be able to test it and play around with it. Just a note: The code was written very fast and inefficiently so don’t consider it anything more than proof of concept. At any rate, here you go.

ExcelImporter.zip (18.51 kb)



Currently rated 4.0 by 1 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

C#, Excel , , ,

Blogging with BlogEngine.Net

25. February 2009

I found a few simple applications that make blogging in BlogEngine.Net very easy and convenient. Hopefully you will as well.

Windows Live Writer
http://get.live.com/writer/overview
I didn’t know Live had a blogging application let alone one that will automatically connect to my Blog for me to post on. This application makes things very easy as I prefer desktop applications over web applications.

Paste From Visual Studio
http://gallery.live.com/liveItemDetail.aspx?li=d8835a5e-28da-4242-82eb-e1a006b083b9&l=8
This little number is my replacement to CodeToHtml plugin I used on VOX. It is a plugin for Windows Live Writer that can paste in things from your Visual Studio clipboard and keep them formatted nicely for your blog. Plus, it is a plugin for Live Writer and not visual studio keeping things on the development end nice and tidy.

Happy Coding :)



Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Visual Studio, BlogEngine.Net