2016-07-22 1 views
1

Salut J'essaie de compiler mon projet en utilisant MSBuild & Psake mais j'ai des problèmes en passant le/m à MSBuild. Voici mon code:Psake - Comment activer/m pour MSBuild?

Exec { 
    MSBuild $solutionFile "/p:Configuration=$buildConfiguration;Platform=$buildPlatform;OutDir=$tempPath /m" 
} 

MSBuild Sortie:

"C:\Users\mabre\Source\Psake\Psake.sln" (default target) (1) -> "C:\Users\mabre\Source\Psake\src\Psake.Library\Psake.Library.xproj" (default target) (5) -> C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets(262,5): error : Could not find a part of the path 'C:\Users\mabre\Source\Psake.build\temp \m\src\Psake.Library\obj\Release\netstandard1.6'. [C:\Users\mabre\Source\Psake\src\Psake.Library\Psake.Library.xproj]

0 Warning(s) 
4 Error(s) 

Notez que le /m fait partie du chemin de sortie maintenant

Error: 7/22/2016 12:39:04 AM: At C:\Users\mabre.nuget\packages\psake\4.6.0\tools\psake.psm1:156 char:17 + throw ("Exec: " + $errorMessage) +
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [<<==>>] Exception: Exec: Error executing command MSBuild $solutionFile "/p:Configuration=$buildConfiguration;Platform=$buildPlatform;OutDir=$tempPath /m" . Build exit code: 1

Merci à l'avance

+0

Avez-vous essayé de mettre le '/ m' d'abord au lieu de dernier, afin qu'il ne soit pas affecté par ce Psake pourrait ajouter après? – stijn

Répondre

3

Essayez-le sans mettre tous les arguments dans une chaîne. Voici deux exemples de ce que mes tâches MSBuild ressemblent à pSake:

Task CleanProject -depends RestoreNuget { 
    Exec { 
     msbuild ` 
      "$VisualStudioSolutionFile" ` 
      /target:Clean ` 
      /property:Configuration=$Configuration ` 
      /verbosity:quiet 
    } 
} 

et ...

Task BuildProject -depends DeleteBinAndObjFolders { 
    Exec { 
     msbuild ` 
      "$ProjectPath" ` 
      /target:Rebuild ` 
      /property:Configuration=$Configuration ` 
      /property:OutDir="$ProjectBuildArtifactsPath" ` 
      /property:UseWPP_CopyWebApplication=True ` 
      /property:PipelineDependsOnBuild=False ` 
      /property:WebProjectOutputDir="$WebBuildArtifactsPath" ` 
      /verbosity:quiet 
    } 
} 

Notez que je mets " autour de toutes les variables que je pense peut contenir des espaces.

Donc, essayez quelque chose comme ça pour le vôtre:

Exec { 
    MSBuild "$solutionFile" /p:Configuration=$buildConfiguration;Platform=$buildPlatform;OutDir="$tempPath" /m 
} 
+0

Pefect, merci! – Miguel