Publish ClickOnce from the command line

Is there a way for Visual Studio 2008 to execute the Publish Now button from the command line?

I have seen posts that suggest using msbuild / target: publish to invoke it. This is normal, but MSBuild does not increment the version number. I hope for something like:

devenv mysolution.sln /publish
+3
source share
1 answer

To increase build numbers, I use the MSBuild Extension pack inside my .csproj file as follows:

<Target Name="BeforeBuild" Condition=" '$(Configuration)|$(Platform)' == 'Release-VersionIncrement|AnyCPU' ">
  <CallTarget Targets="CleanAppBinFolder" />
  <MSBuild.ExtensionPack.VisualStudio.TfsSource TaskAction="Checkout" ItemCol="@(AssemblyInfoFiles)" WorkingDirectory="C:\inetpub\wwwroot\MySolution" ContinueOnError="true" />
  <!-- Microsoft task that goes over assembly files and increments revision number. -->
  <MSBuild.ExtensionPack.Framework.AssemblyInfo Condition="'$(Optimize)'=='True' " AssemblyInfoFiles="@(AssemblyInfoFiles)" AssemblyRevisionType="AutoIncrement" AssemblyFileRevisionType="AutoIncrement">
    <Output TaskParameter="MaxAssemblyVersion" PropertyName="MaxAssemblyVersion" />
  </MSBuild.ExtensionPack.Framework.AssemblyInfo>
  <Message Text="----current version---: '$(MaxAssemblyVersion)'" />
</Target>

, , Release-VersionIncrement, . , MSBuild :

msbuild c:\projects\MyProject.csproj /T: ResolveReferences; _CopyWebApplication /: = ; BuildingProject = ; WebProjectOutputDir = C:\Inetpub\Wwwroot\OutputProject\MyProjectOutput; OutDir = C:\Inetpub\Wwwroot\OutputProject\MyProjectOutput

, - ASP.NET 3.5.

+4

Source: https://habr.com/ru/post/1716840/


All Articles