2009-09-24 7 views
6

Je commence à utiliser nant pour les versions de build. Mais j'ai commencé à utiliser asp.net MVC, et j'ai choisi de faire l'installation pour l'installation avec un .vdproj.J'ai une erreur de construction d'un .vdproj sur msbuild avec nant

Mais, quand je l'appelle le:

< exec program="${dotnet.dir}/msbuild.exe" commandline='"./Wum.sln" /v:q /nologo /p:Configuration=Release' />

à Nant, mon résultat est:

[exec] D:\My Documents\Visual Studio 2008\Projects\Wum\Wum.sln : warning MS 
B4078: The project file "Wum.Setup\Wum.Setup.vdproj" is not supported by MSBuild 
and cannot be built.

Quelqu'un a une idée, ou une solution?

Si j'utilise le devenv, j'aurai un problème? MSBuild ne peut pas créer de projets .vdproj.

Répondre

7

Vous devriez utiliser Visual Studio (devenv.com) pour cela.

+0

... ou passer du projet d'installation et de déploiement de Visual Studio .NET à WiX qui sera de toute façon supporté dans VS 2010. –

+0

Jetez un oeil à http://wix.sourceforge.net/ pour plus d'informations sur WiX. –

+0

*** POURQUOI MSBuild ne peut pas créer de projets .vdproj ***? toute référence complète dans MSDN? De toute façon, 'Wix' a une très grande courbe d'apprentissage ** ** – Kiquenet

3

Pour votre information, c'est toujours pas pris en charge dans .NET 4.0

10

Voici comment je l'ai fait récemment à l'aide devenv comme msbuild ne fera pas les fichiers .vdproj. Cet article a vraiment aidé à mettre à jour le fichier .vdproj premier: http://www.hanselman.com/blog/BuildingMSIFilesFromNAntAndUpdatingTheVDProjsVersionInformationAndOtherSinsOnTuesday.aspx

<target name="someTarget"> 
    <!-- full path to setup project and project file (MSI -> vdproj) --> 
    <property name="DeploymentProjectPath" value="fullPath\proj.vdproj" /> 
    <!-- full path to source project and project file (EXE -> csproj) --> 
    <property name="DependencyProject" value="fullPath\proj.csproj" /> 
    <script language="C#"> 
    <code> 
     <![CDATA[ 
     public static void ScriptMain(Project project) 
     { 
      //Purpose of script: load the .vdproj file, replace ProductCode and PackageCode with new guids, and ProductVersion with 1.0.SnvRevisionNo., write over .vdproj file 

      string setupFileName = project.Properties["DeploymentProjectPath"]; 
      string productVersion = string.Format("1.0.{0}", project.Properties["svn.revision"]); 
      string setupFileContents; 

      //read in the .vdproj file   
      using (StreamReader sr = new StreamReader(setupFileName)) 
      { 
       setupFileContents = sr.ReadToEnd(); 
      } 

      if (!string.IsNullOrEmpty(setupFileContents)) 
      { 
       Regex expression2 = new Regex(@"(?:\""ProductCode\"" = \""8.){([\d\w-]+)}"); 
       Regex expression3 = new Regex(@"(?:\""PackageCode\"" = \""8.){([\d\w-]+)}"); 
       Regex expression4 = new Regex(@"(?:\""ProductVersion\"" = \""8.)(\d.\d.\d+)"); 
       setupFileContents = expression2.Replace(setupFileContents,"\"ProductCode\" = \"8:{" + Guid.NewGuid().ToString().ToUpper() + "}"); 
       setupFileContents = expression3.Replace(setupFileContents,"\"PackageCode\" = \"8:{" + Guid.NewGuid().ToString().ToUpper() + "}"); 
       setupFileContents = expression4.Replace(setupFileContents,"\"ProductVersion\" = \"8:" + productVersion); 

       using (TextWriter tw = new StreamWriter(setupFileName, false)) 
       { 
        tw.WriteLine(setupFileContents); 
       } 
      } 
     } 
     ]]> 
    </code> 
    </script> 

    <!-- must build the dependency first (code project), before building the MSI deployment project --> 
    <exec program="Devenv.exe" commandline='"fullPath\solution.sln" /rebuild "Release" /project "${DependencyProject}" /out "fullPath\somelog.log"'/> 
    <exec program="Devenv.exe" commandline='"fullPath\solution.sln" /rebuild "Release" /project "${DeploymentProjectPath}" /out "fullPath\somelog.log"'/> 
</target> 
+0

@GarrisonNeely Avez-vous essayé un script comme '% DevEnv%" BaseSln% "/ build"% BuildConfiguration% |% BuildPlatform% "/ Projet"% BaseVdproj% "/ Out" vs_errors.txt "'? – Kiquenet

+0

S'applique aussi *** Script MSBuild *** ('* .targets')? – Kiquenet

1

Juste pour développer l » après crisis - la construction d'un projet vdproj utilisant devenv VS2010 par la ligne de commande ne fonctionne pas. Avant-2010 fonctionne bien je crois (voir link text)

+0

On dirait qu'il y a quelques problèmes, j'utilisais 2008. Microsoft a déclaré "L'estimation actuelle pour le correctif est mi-août." – CRice

Questions connexes