Continuous Migration VBUC-MS Team System 2005: Configure MS Visual Studio 2005 to use Team System

22. September 2009 08:57 by Mrojas in General  //  Tags: , , , , , , ,   //   Comments (0)

This post will show you the necessary steps to configure Microsoft Visual Studio 2005 to use a Team System Project. In this example we will use a Team Project created to illustrate Continuous Migration with VBUC and MS Team System 2005, called MergeExample.

1. Start Microsoft Visual Studio 2005

2.  Go to the File Menu\Open\Team Project…

image

3. Dialog is presented, where you can choose your Team Foundation Server, and the Team Project to use. For these Continuous Migration example we’ll assume a project called MergeExample.

image

4. The Team Explorer is shown, with your selected project.
Expand the elements for the Team Project you previously selected.

image

5.  We now have to map our local directories to bind them to the
source control system. On the expanded tree, double click on the
Source Control Node

image

6. The Source Code Explorer is shown:

image

7.  Go to the Workspaces dropdown box and select Workspaces…

image

8.  The Manage workspace dialog is shown.
Select the appropiate workspace and click Edit…

image 

9. On the Edit Workspace dialog type a description for your source control and select the source control Folder we had created (for this example it is $/MergeExample) and the directory for your code (for this example it is C:\MergeExample).

image 

 

 

 

 

 

NOTE: if a message box about a pending update is shown, just click ok.

 

Now you have successfully mapped your directories, and you can start setting up your VB6 code for continuous migration

Minimize pain when executing Visual Basic 6 migrations in a Migration Factory Model.

18. May 2009 07:06 by algomez in General  //  Tags: , ,   //   Comments (0)

More and more companies are deciding to migrate their portfolio of Visual Basic 6.0 applications using a Migration Factory Model where knowledge, tools, methodologies and resources are reused.  A successful Visual Basic 6.0 migration to .NET in a migration factory model can bring enormous benefits if executed correctly and a lot of pain if not.

For that reason, here is a list of factors that should be taken into account by your factory teams to minimize pains, risks and ensure success:

  • Use a proven methodology to do software migrations from VB6 to .NET. ArtinSoft can help you review and tune your migration methodology based on years of experience to help mitigate risks and execute cost-effective migrations.
  • Knowledge transfer – Every migration project is different but having a knowledge base of best practices, learnings and manual changes in place and updated with every project, will give you a great tool to successfully complete your projects. Within your migration methodology you need to make sure that your teams are constantly updating this repository, especially during the manual changes phase. Developers won’t have to spend time doing research, trial and error exercises or navigating in the internet since the solution will be in this repository.
  • VBUC customizations are a key part of a migration methodology in a factory model. These customizations will increase the automatic migration rate, minimize manual work on pending projects and ensure that effort, duration and financial goals will be achieved. The knowledge base created during the migration process is the best input for VBUC customizations. You need to ensure that knowledge is gathered and store in a repository at all times.
  • Reengineering versus functional equivalence – Integrating source code migration work with reengineering work will drastically increase the complexity of your migration project. Whenever possible, plan for a staged migration where you achieve functional equivalence first and then work on reengineering tasks.
  • For optimal migration factory team performance, communication is a key. Not always everything is documented so besides the knowledge base, you need to integrate the different teams to learn from each other.
  • Dependencies between projects may minimize the ability to migrate projects in parallel. During the detailed assessment phase you need to work o a migration plan where you clearly define the dependencies between the different projects in your portfolio. You usually do this by using the VBUC in assessment model, application surveys, priorization lists and interviews with application developers.
  • The migration factory requires migration experts especially at early stages of the process. Be aware of training your people in advanced to be productive at early and not middle stages of the migration process.

Migration of ActiveX UserDocuments to C# or .NET

This post describes an an interesting workaround that you can use to support the migration of ActiveX Documents with the Artinsoft Visual Basic Upgrade Companion which is one of the Artinsoft \ Mobilize.NET tools you can use to modernize your Visual Basic, Windows Forms and PowerBuilder applications.

Currently the Visual Basic Upgrade Companion does not allow you to process ActiveX Document directly, but there is a workaround: in general ActiveX Document are something really close to an User Control which is a element that is migrated automatically by the Visual Basic Upgrade Companion.

This post provides a link to a tool (DOWNLOAD TOOL) that can fix your VB6 projects, so the Visual Basic Upgrade Companion processes them. To run the tool:

1) Open the command prompt

2) Go to the Folder where the .vbp file is located

3) Execute a command line command like:

 FixUserDocuments Project1.vbp

This will generate a new project called Project1_modified.vbp. Migrate this new project and now UserDocuments will be supported.

  

First Some History
 

VB6 allows you to create UserDocuments, which can be embedded inside an ActiveX container. The most common one is Internet Explorer. After compilation, the document is contained in a Visual Basic Document file (.VBD) and the server is contained in either an .EXE or .DLL file. During development, the project is in a .DOB file, which is a plain text file containing the definitions of the project’s controls, source code, and so on.

If an ActiveX document project contains graphical elements that cannot be stored in text format, they will be kept in a .DOX file. The .DOB and .DOX files in an ActiveX document project are parallel to the .FRM and .FRX files of a regular Visual Basic executable project. 

The trick to support ActiveX documents is that in general they are very similar to UserControls, and .NET UserControls can also be hosted in a WebBrowser. The following command line tool can be used to update your VB6 projects. It will generate a new solution where UserDocuments will be defined as UserControls.

 

If you have an ActiveX document like the following: 

 

Then after running the tool you will have an Project like the following:

 

So after you have upgraded the projet with the Fixing tool, open the Visual Basic Upgrade Companion  and migrate your project.

After migration you will get something like this:

 

 

To use your migrated code embedded in a Web Browser copy the generated assemblies and .pdb to the directory you will publish:

Next create an .HTM page. For example UserDocument1.htm

The contents of that page should be something like the following:

 

<html>

<body>

<p>ActiveX Demo<br> <br></body>

<object id="UserDocument1"

classid="http:<AssemblyFileName>#<QualifiedName of Object>"

height="500" width="500" VIEWASTEXT>   

</object>

<br><br>

</html>

 

For example:

<html>

<body>

<p>ActiveX Demo<br> <br></body>

<object id="UserDocument1"

classid="http:Project1.dll#Project1.UserDocument1"

height="500" width="500" VIEWASTEXT>   

</object>

<br><br>

</html>

  

 Now all that is left is to publish the output directory.
To publish your WinForms user control follow these steps.

  1. Create a Virtual Directory:

  1. A Wizard to create a Virtual Directory will appear.

 

 Click Next

 Name the directory as you want. For example Project1. Click Next

 Select the location of your files. Click the Browse button to open a dialog box where you can select your files location. Click Next

 Check the read and run scripts checks and click next

 Now Click Finish

  1. Properties for the Virtual Directory will look like this:

 

NOTE: to see this dialog right click over the virtual directory

 

  1. Now just browse to the address lets say http:\\localhost\Project1\UserDocument1.htm

 And that should be all! :)

 

 

 

The colors are different because of the Host configuration however a simple CSS like:

 

<style>

 body {background-color: gray;}

</style>

 

Can make the desired change:

 

 

 

Notice that there will be security limitations, for example for thinks like MessageBoxes.

You can allow restricted operations by setting your site as a restricted site:

 

For example:

 

 

Restrictions

The constraints for this solution include:

 

* This solutions requires Windows operating system on the client side

* Internet Explorer 6.0 is the only browser that provides support for this type of hosting

* It requires .NET runtime to be installed on the client machine.

* It also requires Windows 2000 and IIS 5.0 or above on the server side

 

Due to all of the above constraints, it might be beneficial to detect the capabilities of the client machine and then deliver content that is appropriate to them. For example, since forms controls hosted in IE require the presence of the .NET runtime on the client machine, we can write code to check if the client machine has the .NET runtime installed. You can do this by checking the value of the Request.Browser.ClrVersion property. If the client machine has .NET installed, this property will return the version number; otherwise it will return 0.0.

 

Adding a script like:

 

<script>

 if ((navigator.userAgent.indexOf(".NET CLR")>-1))

 {

      //alert ("CLR available " +navigator.userAgent);

 }

  else

      alert(".NET SDK/Runtime is not available for us from within " +            "your web browser or your web browser is not supported." +            " Please check with http://msdn.microsoft.com/net/ for " +            "appropriate .NET runtime for your machine.");

 

</script>

Will help with that.

 References:

 

ActiveX Documents Definitions:

http://www.aivosto.com/visdev/vdmbvis58.html

 

 

Hosting .NET Controls in IE

http://www.15seconds.com/issue/030610.htm

 

 

Categories