My requirement is to change the ProductName in the application manifest file. I did the solution mentioned here, but for me, the product name still doesn't change. In the log, I can see that the GenerateApplicationManifest
task is not getting executed. The log says:
Skipping target "GenerateApplicationManifest" because all output files are up-to-date with respect to the input files.
But I want this task to run, so that the product name is changed. This is the code.
<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>
After Line 1
, I can see the correct publisher & product names set in the .application & .exe.manifet files (eg: PublisherName is set to MyCompany
, ProductName is set to My Company Software
). After Line 4
is executed, the publisher name stays correct, but the product name is then replaced with the assembly name (eg: ProductName changes to My.Company.Software
). For correcting this, I've added Line 5
, which ideally should have corrected the ProductName, but it doesn't happen.
What could be the problem here? Why is this task ignored by MSBUILD?