Issue with clickonce bootstrapper and msbuild

后端 未结 9 1184
长发绾君心
长发绾君心 2020-12-28 08:25

I have a CruiseControl .NET build server running on Windows Server 2003, and I am trying to build and publish my ClickOnce application using msbuild.

Everything is w

相关标签:
9条回答
  • 2020-12-28 08:53

    Hi I know this answer its soooooo late but just in case

    I had to add the Path prop to the task, with the Path where the bootstrapper its located, in my case I used Visual Studio 2015 so the Path is:

    **Program Files(x86)\Microsoft Visual Studio 14.0\SDK\Boostrapper**

    MSBuild has a Task GenerateBootstrapper in my case

        <GenerateBootstrapper> 
           AplicationFile="$(AppName)"
           ApplicationName=..
           ApplicationUrl=..
           BootstrapperItems=..
           Culture=..
           ApplicationUrl=.. 
           Path="Program Files(x86)\Microsoft Visual Studio 14.0\SDK\Boostrapper\"
        </GenerateBootstrapper>
    

    with this the MSBuild is able to recognize and generate the file

    Now i'm stucked with the .net 4 bootstrapper but guess is another story...

    0 讨论(0)
  • 2020-12-28 08:53

    I added this line to script. It helped.

    call "%VS120COMNTOOLS%vsvars32.bat"
    

    Visual Studio 2013, SDK v8.1A.

    0 讨论(0)
  • 2020-12-28 08:54

    Just struggled with this myself - I chose to commit the bootstrapper files to source control. It is possible to override the path to bootstrappers, just provide /p:GenerateBootstrapperSdkPath=.build\Bootstrapper

    Then no need to modify registry - and the added benefit that the build is now self-contained.

    Only "problem" is that I have to manually copy the Bootstrapper files into source control. In my case (VStudio2015), this meant copying the files from C:\Program Files (x86)\Microsoft Visual Studio 14.0\SDK\Bootstrapper

    0 讨论(0)
  • 2020-12-28 08:59

    You can also pass the location of the bootstrapper packages to the common Publish target like this:

    <PropertyGroup>
         <BootstrapperSdkPath>C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\Bootstrapper</BootstrapperSdkPath>
    </PropertyGroup>
    

    and then

    <Target Name="Publish">
        <MSBuild Targets="publish" ... Properties="GenerateBootstrapperSdkPath=$(BootstrapperSdkPath); ..."/>
    </Target>
    
    0 讨论(0)
  • 2020-12-28 09:04

    I was able to fix this problem by pointing to MSBuild.exe from this location

    C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe

    Previously I was pointing to

    C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe

    0 讨论(0)
  • 2020-12-28 09:06

    I experienced this same error via my TeamCity build server. The cause in my case was that I was running an MSBuild task against my .sln file, with a 'MyProject:publish' target. In this case, the solution+projecth had been updated to target .NET v4.5, but the build server was still configured to use MSBuild Tools 4.0 and .NET v4.0.

    Took me a little while to work out the inconsistency between working and non-working branch builds.

    0 讨论(0)
提交回复
热议问题