Problems using MsBuild using command line for Publish Click Once

Alhambra Eidos picture Alhambra Eidos · Jan 25, 2010 · Viewed 19.7k times · Source

I have Windows application in csproj in my solution, and I want generate Publish using command line (bat, cmd).

My script is (I put \r\n for better reading):

 SET MSBUILD="%SystemRoot%\Microsoft.NET\Framework\v3.5\MSBuild.exe"
    SET CARWIN="..\..\Security.CarWin.csproj"

    rem msbuild para publish

    %MSBUILD% /target:rebuild;publish %CARWIN% 
/p:ApplicationVersion="1.0.0.0" 
/p:Configuration=release 
/p:PublishUrl="C:\ClickOnce\CarWin.WebInstall\Publicacion\" 
/p:InstallUrl="http://desserver/carwinclickonce/Publicacion/" 
/p:PublishDir="C:\ClickOnce\CarWin.WebInstall\Publicacion\" 

note: I'll try too using /target:publish

But in path PublishDir or PublishUrl (C:\ClickOnce\CarWin.WebInstall\Publicacion) not generates any files.

I have seen many posts in this site and google but I not found any solution.

Answer

David De Sloovere picture David De Sloovere · Dec 5, 2013

Use PublishDir instead of PublishUrl when running from command line.

msbuild /target:publish /p:Configuration=Release;PublishDir=c:\playground\

You can also change version, like ApplicationRevision=666;MinimumRequiredVersion=1.1