I want create build task for my VB6 Projects

Nov 6, 2008 at 10:45 AM
Hi

I need create build tasks for two cases

1) A daily nigth in all days of week, to build my projects and have a version to deploy in a testers machines
2) A build task to execute in all checkin of VB6 code

Any help and suggention would be apreciated

Thanks
Coordinator
Nov 6, 2008 at 9:21 PM
Hi, could you provide a few more details. Are you using TFS?

Nov 7, 2008 at 7:45 AM
Yes

I'm using TFS 2008. I make a build with the wizard, but I change the TFSBuild.proj manually, see the post on

http://social.msdn.microsoft.com/forums/en-US/tfsbuild/thread/a6c7cb1b-07ab-425c-adb3-481c912a8907

My name on post is Julio Trujillo Leon

In this post I explained the details of my investigation


Thank You
Coordinator
Nov 7, 2008 at 8:03 AM
Ah, its making more sense now Julio. :-)

did you see my reply to that post and did it help get a successful build?

"I think the issue is that you are overriding the whole build process and the CompilationStatus that would normally be set is not being set. It remains at it's default (Unknown) and the result is a Failed build. Try using the SetBuildProperties task to update the CompilationStatus to Succeeded / Failed as appropriate."

Mike

Nov 7, 2008 at 8:11 AM
Thanks Mike for your time

I understood that I may use  SetBuildProperties  and set the property CompilationStatus = "Suceed" and then the task has marked like a task sucesful, but I imgine that its under conditional thats the process terminate fine ¿How I determine that the process finshed fine? In other words ¿How I express in script XML languaje the conditional "if MyProceess=NoError then..."

Any help and suggention would be apreciated

Thanks
Coordinator
Nov 7, 2008 at 2:57 PM
I think you are after something like this

  <Target Name="EndToEndIteration"
    Condition=" '$(IsDesktopBuild)'!='true' "
    DependsOnTargets="$(EndToEndIterationDependsOn)" >
    <CallTarget Targets="Default"/>
    <SetBuildProperties TeamFoundationServerUrl="$(TeamFoundationServerUrl)" BuildUri=$(BuildUri)" Status="Succeeded" />
    <OnError ExecuteTargets="OnError"/>

  </Target>
    <Target Name="OnError">
        <SetBuildProperties TeamFoundationServerUrl="$(TeamFoundationServerUrl)" BuildUri=$(BuildUri)" Status="Failed" />
    </Target>
Dec 3, 2008 at 8:12 AM
Excuse me Mike

I have to work to hard in last weeks because have a lot of work, and cant dispose of time to make sample that you pass me, any things succeed that the system of msbuild at this time dont work.

I allready reinstall (or are present gosth in my enterprise :)) (joke) a new version of MSBuild.extensionspacks (3.5.1.0, but i have in the past 3.5.0.0) another person in my enterprise probabily install it.

In this new version none of samples of VB6 Builds  thats running in the past ok run, now not fine. I can't compile with msbuild

This is a script that running ok in the past and now not running (I have cut a part the original script in this flow post for abreviate, the original nor work)

<

 

Project ToolsVersion="3.5" DefaultTargets="Default" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

 

<

 

PropertyGroup>

 

 

 

 

<

TPath>$(MSBuildExtensionsPath)\MSBuild.ExtensionPack.tasks</TPath>

 

<

 

TPath Condition="Exists('$(MSBuildExtensionsPath)\ExtensionPack\MSBuild.ExtensionPack.tasks')">$(MSBuildExtensionsPath)\ExtensionPack\MSBuild.ExtensionPack.tasks</TPath>

 

</

 

PropertyGroup>

 

<

 

Import Project="$(TPath)"/>

 

<

 

ItemGroup>

 

<

 

ProjectsToBuild Include="C:\AplicacionExeSola\AplicacionExeSola.vbp">

 

<

 

OutDir>C:\AplicacionExeSola</OutDir>

 

</

 

ProjectsToBuild>

 

</

 

ItemGroup>

 

<

 

Target Name="Default">

 

<!--

 

Build a collection of VB6 projects -->

 

 <

 

MSBuild.ExtensionPack.VisualStudio.VB6 VB6Path="C:\Archivos de programa\Microsoft Visual Studio\VB98\VB6.EXE" TaskAction="Build" Projects="@(ProjectsToBuild)"/>

 

</

Target>

 

<

 

Target Name="EndToEndIteration"

 

 

 

Condition=" '$(IsDesktopBuild)'!='true' "

 

 

 

DependsOnTargets="$(EndToEndIterationDependsOn)" >

 

<

 

CallTarget Targets="Default"/>

 

</

 

Target>

 

</

 

Project>

 

the message thats appear is it (trnslate spanish to english later, look asterisk line importants)

Compilación iniciada a las 03/12/2008 09:01:47.

Proyecto "C:\WINDOWS\TEMP\ImplantacionTS\AplicacionExeSola\BuildType\TFSBuild.proj" en el nodo 0 (EndToEndIteration destinos).

Generando con la versión de herramientas "3.5".

Destino "EndToEndIteration" en el archivo "C:\WINDOWS\TEMP\ImplantacionTS\AplicacionExeSola\BuildType\TFSBuild.proj" del proyecto "C:\WINDOWS\TEMP\ImplantacionTS\AplicacionExeSola\BuildType\TFSBuild.proj":

Utilizando la tarea "CallTarget" del ensamblado "Microsoft.Build.Tasks.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".

Tarea "CallTarget"

Destino "Default" en el archivo "C:\WINDOWS\TEMP\ImplantacionTS\AplicacionExeSola\BuildType\TFSBuild.proj" del proyecto "C:\WINDOWS\TEMP\ImplantacionTS\AplicacionExeSola\BuildType\TFSBuild.proj":

Utilizando la tarea "MSBuild.ExtensionPack.VisualStudio.VB6" del ensamblado "C:\Archivos de programa\MSBuild\ExtensionPack\MSBuild.ExtensionPack.dll".

Tarea "MSBuild.ExtensionPack.VisualStudio.VB6"

Building Projects Collection: 1 projects

(*1) Running /MAKE /OUT "C:\AplicacionExeSola\AplicacionExeSola.vbp.log" "C:\AplicacionExeSola\AplicacionExeSola.vbp" /outdir "C:\AplicacionExeSola"

(*2) C:\WINDOWS\TEMP\ImplantacionTS\AplicacionExeSola\BuildType\TFSBuild.proj(19,5): error : InvalidOperationException: No se puede iniciar el proceso porque no se proporcionó ningún nombre de archivo.

C:\WINDOWS\TEMP\ImplantacionTS\AplicacionExeSola\BuildType\TFSBuild.proj(19,5): error :

Ejecución de la tarea "MSBuild.ExtensionPack.VisualStudio.VB6" terminada -- ERROR.

Compilación terminada del destino "Default" en el proyecto "TFSBuild.proj" -- ERROR.

Ejecución de la tarea "CallTarget" terminada -- ERROR.

Compilación terminada del destino "EndToEndIteration" en el proyecto "TFSBuild.proj" -- ERROR.

Compilación del proyecto terminada "C:\WINDOWS\TEMP\ImplantacionTS\AplicacionExeSola\BuildType\TFSBuild.proj" (EndToEndIteration destinos) -- ERROR.

ERROR al generar.

"C:\WINDOWS\TEMP\ImplantacionTS\AplicacionExeSola\BuildType\TFSBuild.proj" (EndToEndIteration destino) (1) ->

(Default destino) ->

C:\WINDOWS\TEMP\ImplantacionTS\AplicacionExeSola\BuildType\TFSBuild.proj(19,5): error : InvalidOperationException: No se puede iniciar el proceso porque no se proporcionó ningún nombre de archivo.

C:\WINDOWS\TEMP\ImplantacionTS\AplicacionExeSola\BuildType\TFSBuild.proj(19,5): error :

0 Advertencia(s)

1 Errores

Tiempo transcurrido 00:00:00.85

(*1) The line of running dont have C:\Archivos de programa\Microsoft Visual Studio\VB98\VB6.EXE
(*2) VB6Path="C:\Archivos de programa\Microsoft Visual Studio\VB98\VB6.EXE" exists vb6 on this path on target machine msbuild agent!!!!! in line 19 of script i have this <MSBuild.ExtensionPack.VisualStudio.VB6 VB6Path="C:\Archivos de programa\Microsoft Visual Studio\VB98\VB6.EXE" TaskAction="Build" Projects="@(ProjectsToBuild)"/>

Could you help me again?????


Thank you Mike




Dec 3, 2008 at 9:41 AM
Oops !!!! I have encountered an important bug on VB6 class !!!!

I supose that run my VB6 builds because I make on an Virtual PC that the idiom is english, But now I apply this scripts on really machine that have an spanish laguage

When the SO language of target machine is not english this path not exist: "C:\Program Files\Microsoft Visual Studio\VB98\VB6.exe" 
The folder in spanish language is "c:\archivos de programas..."

The VB6 class have this property THATS NEVER USE !!!!!! VB6Path. If you see the code:

            if (string.IsNullOrEmpty(this.VB6Path))
            {
                if (File.Exists(@"C:\Program Files\Microsoft Visual Studio\VB98\VB6.exe"))
                {
                    this.visualBasicPath = @"C:\Program Files\Microsoft Visual Studio\VB98\VB6.exe";
                }
                else if (File.Exists(@"C:\Program Files (x86)\Microsoft Visual Studio\VB98\VB6.exe"))
                {
                    this.visualBasicPath = @"C:\Program Files (x86)\Microsoft Visual Studio\VB98\VB6.exe";
                }
                else
                {
                    Log.LogError("VB6.exe was not found in the default location. Use VB6Path to specify it.");
                    return;
                }
            }

            .....


Where is the sentence thats need this procedure like this?

            }
            else
                this.visualBasicPath = VB6Path

No where

I worte an issue traker with this

Thank you

Dec 3, 2008 at 10:03 AM
Hellow again Mike

I download the source and I fix the bug, I compile it but when I copy dll result to folder machine that have installed extensions pack, I launch a build and I obtatin a error message:

C:\WINDOWS\TEMP\ImplantacionTS\AplicacionExeSola\BuildType\TFSBuild.proj(19,5): error MSB4062: No se pudo cargar la tarea "MSBuild.ExtensionPack.VisualStudio.VB6" desde el ensamblado. C:\Archivos de programa\MSBuild\ExtensionPack\MSBuild.ExtensionPack.dll. No se puede cargar el archivo o ensamblado 'MSBuild.ExtensionPack, Version=3.5.0.0, Culture=en-GB, PublicKeyToken=10d297e8e737fe34' ni una de sus dependencias. Error de validación del nombre seguro. (Excepción de HRESULT: 0x8013141A) Confirme que la declaración <UsingTask> es correcta y que el ensamblado y todas sus dependencias están disponibles.

translate
DONT POSSIBLE LAUNCH TASK "MSBuild.ExtensionPack.VisualStudio.VB6" FROM ASSEMBLY C:\Archivos de programa\MSBuild\ExtensionPack\MSBuild.ExtensionPack.dll AND HIS REFRENCES. ERROR OF VALIDATION AN STRONG NAME. CONFIRM THE DECLARATION <UsingTask> IS CORRECT AND ASSEMBLY AND HIS REFERENCES ARE ENABLED

I imagine that is one of these situation
1) I need a file .snk to make strong name on dll or
2) I need use GAC to register this assembly or
3) I have compiled incorrect version (distinct that I have installed)

Could you help me?

Thanks

Dec 3, 2008 at 10:32 AM
Oooooooohh  :DDDDD Aleluyaaaaaah

I find the way for compile the dll of vb6 class!!!!!!

That's all you need is an .snk file to sign (firm) the assembly with strong name

I select an .snk of may company. With this we sign all our assemblies. The dll generated run perfectly!!!!!!!!!

In other cuestions Mike, I think that I may colaborate in this project like developer. In the future I make a code oriented to VB6 developers that make easy, because my compnie need it, if you consider that my aportations of code will good tell me please.

Thank you for all yor time

Julio Trujillo Leon
Coordinator
Dec 5, 2008 at 10:21 PM
Hi Julio

if you compile the code, its delay signed, you need to skip strong name verification. run this from a  command prompt

sn.exe -Vr *,10d297e8e737fe34

also make sure you are on the right branch, at this time, you probably want to be on the Releases -3.5.1.0 branch.

I've just checked in  a fix for your issues.

Thanks very much for the feedback. It's really great to get feedback on additional language support! I'll follow up via email to you.

Mike