我的要求是更改应用程序清单文件中的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="$(PublisherName)";ProductName="$(ClickOnceAppTitle)";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 "$(PublisherName)" -UseManifestForTrust t" />
Line 4: <Exec Command="$(MAGE) -UPDATE $(AppManifest) -AppManifest $(DeployManifest) -CertFile $(CertFile) -Password $(Password) -pub "$(PublisherName)" -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会忽略此任务?