强制GenerateApplicationManifest在MSBUILD中运行

时间:2013-02-12 12:57:50

标签: msbuild clickonce manifest publish

我的要求是更改应用程序清单文件中的ProductName。我做了here提到的解决方案,但对我来说,产品名称仍然没有改变。在日志中,我可以看到GenerateApplicationManifest任务没有被执行。日志说:

Skipping target "GenerateApplicationManifest" because all output files are up-to-date with respect to the input files.

但我想要运行此任务,以便更改产品名称。这是代码。

<DeployEXE>The application .exe file</DeployEXE>
<DeployManifest>The .exe.manifest file</DeployManifest>
<AppManifest>The .application file</AppManifest>

Line 1: <Exec Command="$(Msbuild) $(ClientAppProject) /t:Clean;Publish /p:BootstrapperEnabled=true;UpdateRequired=true;MinimumRequiredVersion=$(Version);UpdateEnabled=true;UpdateMode=Foreground;UpdateInterval=7;UpdateIntervalUnits=Days;UpdatePeriodically=false;PublishDir=$(PublishDir);ApplicationVersion=$(Version);PublisherName=&quot;$(PublisherName)&quot;;ProductName=&quot;$(ClickOnceAppTitle)&quot;;PublishUrl=$(ClickOnceUrl);GenerateManifests=true;Install=true;Configuration=Release;Platform=AnyCPU"/>

Line 2: <Exec Command="$(SN) -R $(DeployEXE) $(SNKFile)"/>

Line 3: <Exec Command="$(MAGE) -UPDATE $(DeployManifest) -CertFile $(CertFile) -Password $(Password) -pub &quot;$(PublisherName)&quot; -UseManifestForTrust t" />

Line 4: <Exec Command="$(MAGE) -UPDATE $(AppManifest) -AppManifest $(DeployManifest) -CertFile $(CertFile) -Password $(Password) -pub &quot;$(PublisherName)&quot; -UseManifestForTrust t"/>

Line 5: <GenerateApplicationManifest
            AssemblyName="$(EXEName).exe"
            Product="$(ClickOnceAppTitle)"
            EntryPoint="$(EXEName).exe"
            OutputManifest="$(EXEName).exe.manifest">
            <Output
                ItemName="ApplicationManifest"
                TaskParameter="OutputManifest"/>
        </GenerateApplicationManifest>

Line 1之后,我可以看到正确的发布商&amp; .application&amp;中设置的产品名称.exe.manifet文件(例如:PublisherName设置为MyCompany,ProductName设置为My Company Software)。执行Line 4后,发布者名称保持正确,但产品名称将替换为程序集名称(例如:ProductName更改为My.Company.Software)。为了纠正这个问题,我添加了Line 5,理想情况下应该更正了ProductName,但它不会发生。

这可能是什么问题?为什么MSBUILD会忽略此任务?

0 个答案:

没有答案