开发者

Publish Clickonce Project with v4.0 MSBuild fails on 64 bit machines

开发者 https://www.devze.com 2023-03-27 21:46 出处:网络
I have this business application, a winform client which communicates with WCF services. The client is targeted to .net 3.5 framework and the IDE is Visual Studio 2010.

I have this business application, a winform client which communicates with WCF services. The client is targeted to .net 3.5 framework and the IDE is Visual Studio 2010. The project contains a reference to Microsoft Internet Controls and Interop.SHDocVw which is COM object开发者_运维技巧. Our projects target architecture is set to "AnyCPU"

We use a CC.net buildserver which deploys the application to our different environment, Test, QA and Production.

When building for the Production environment and installing the product on a 64 bit Windows 7 machine, it fails to load "SHDocVw" because of incorrect format. When installing on a 32 bit XP machine, it works like a charm.

I know I can try to set my whole solution to target "x86" and not "AnyCPU", but thing is, that when using the previous version of msbuild (v3.5) it works like a charm. Why? Is this a bug in the v4.0 version of msbuild.exe?

The task in CC.net looks like this

        <!-- Deploy of clickonce -->
        <msbuild>
            <executable>C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe</executable>
            <workingDirectory>****</workingDirectory>
            <projectFile>PublishApplication.xml</projectFile>
            <buildArgs>
                /p:ProjectToPublish=******
                /p:Configuration=Release
                /v:diag
                /p:ApplicationVersion=1.0.1.$[$CCNetLabel]
                /p:InstallUrl="*****"
                /p:NewVersionDeployFolder="*****_$[$CCNetLabel]"
                /p:ProductName="*****Test"
                /p:PublisherName="*****"
                /p:UpdateEnable="true"
                /p:UpdateRequired="true"
                /p:MinimumRequiredVersion=1.0.1.$[$CCNetLabel]
            </buildArgs>
            <timeout>900</timeout>
            <logger>C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MSBuild.dll</logger>
        </msbuild>

The PublishApplication.xml does a couple of things like creating folder and copying files, but the build itself is with this task

<Target Name="PublishApplication" DependsOnTargets="Clean">
    <Message Text="Publishing application"/>
    <MSBuild Projects="$(ProjectToPublish)" Targets="Publish"  />
</Target>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号