0

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=&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>

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?

Community
  • 1
  • 1
Sandeep
  • 5,581
  • 10
  • 42
  • 62
  • Which target did you add this task into? Could you copy full code you added to the project file? – seva titov Feb 12 '13 at 16:23
  • Your confusion here is that the MSBuild does not execute *target* called `GenerateApplicationManifest`. Notice that targets and tasks are different concepts. MSBuild never skips tasks (well, unless there is a `Condition` clause in the task that is evaluated to `false`). It sounds like your task does get execute. What is going on here is that in addition to a task called `GenerateApplicationManifest`, there is a target, also called `GenerateApplicationManifest`, which is defined in Microsoft.Common.targets. This might get skipped if MSBuild finds that all outputs are up to date. – seva titov Feb 13 '13 at 15:42
  • @SevaTitov: So what needs to be done here in order to get the ProductName corrected? – Sandeep Feb 14 '13 at 06:11
  • I would start with carefully inspecting MSBuild logs, produced with /v:diag option, making sure the task does get executed, then if needed add diagnostic tasks between task invocations to print out properties you want to confirm, and finally confirming that parameters you pass to `GenerateApplicationManifest` are correct. – seva titov Feb 14 '13 at 15:29

0 Answers0