Bastien Vandamme
Bastien Vandamme

Reputation: 18465

ClickOnce name, publisher and domain. What is it?

I'm currently publishing 2 ClickOnce Application. One in VB and one in C#. I use Azure DevOps to do my builds and deployment. I have 2 * 2 = 4 builds:

  1. VB staging
  2. VB production
  3. C# staging
  4. C# production

I deploy on IIS where I have 4 web sites.

Here is the picture when I go on one of these website to install a version of one of my applications:

enter image description here

Help me identify where these value really come from before and after build or publication.

On the web page first: 4, 5 and 6. The name (4), the version (5) and the publisher (6) are hardcoded in html file deployed with click-once. Let'f forget about these one and focus on 1, 2, 3.

But, for me the most important is the values on the installer screen: 1, 2 and 3. The name (1), the domain (2) and the publisher (3) where are them coming from?

I ask this question because on my VB build everything seems correct but on my C# build I cannot get the correct value for my name, publisher and domain (1, 2, 3).

I use DevOps and Visual Studio Build task with MSBuild Arguments:

/target:publish 
/p:ApplicationVersion=$(Build.BuildNumber) 
/p:InstallURL=http://VBApp-staging.example.com/ 
/p:PublishURL=http://VBApp-staging.example.com/ 
/p:UpdateEnabled=true  
/p:UpdateMode=Foreground  
/p:ProductName="VB App Staging" 
/p:OutputPath="$(build.ArtifactStagingDirectory)\Publish\\"

I also have my sln and proj file PropertyGroup setup for Staging and Release.

  </PropertyGroup>
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Staging|AnyCPU' ">
    <PublishUrl>http://CSApp-staging.example.com/</PublishUrl>
    <InstallUrl>http://CSApp-staging.example.com/</InstallUrl>
    <ProductName>CS Application Staging</ProductName>
    <PublisherName>Example Group</PublisherName>
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>

Both VB and C# have defined similar PropertyGroup and similar Devops pipeline. Now when I run my pipeline for my VB software it seems that all values I can read on (1, 2, 3) are the one from MSBuild overridden arguments. But for my CS software I don't know. It seems the the arguments of MSbuild are doing nothing and all is comong from my project definition.

How is this possible? How can I make sure my MSbuild arguments works. Where these value from (1, 2, 3) come from?

Upvotes: 0

Views: 239

Answers (1)

LoLance
LoLance

Reputation: 28146

How is this possible? How can I make sure my MSbuild arguments works. Where these value from (1, 2, 3) come from?

Value1 comes from msbuild property ProductName and Value2 comes from msbuild property PublishUrl.

If these two properties only works for your VB project but not C# project, you should check the log of C# project to make sure you do choose the Staging+AnyCPU entry which passes corresponding definitions to publish process.

As for Value3,PublisherName property is not something used for this. There's no VS default option can control this, to get that work we need to add custom steps with SignTool. Here's one similar issue and one detailed document you can follow with. Thanks to Arin and erikest!

Feel free to let me know if there's any update:)

Upvotes: 1

Related Questions