Manually publish ClickOnce - c#

I'm trying to automate the build and publish (plus some middle steps) and everything worked fine (it compiles, starts and works as it should, with the manifest and the digital signature that I apply using command line) until I tried to "install" the package using ClickOnce.
I got this very very very strange error:
Reference in the manifest does not match the identity in the downloaded assembly XYZ.application.
The previous one was the same but referring to another file.:
Reference in the manifest does not match the identity in the downloaded assembly XYZ.exe.
(I translated the message from Italian to English so it doesn't match the English version of the error message 100%.)
I've created a batch that uses MSBuild to clean and build, after use mt to embed the manifest and signtool to sign the assembly and, in the end, use Mage to create the manifest for ClickOnce, sign it, update the .application file (I don't use Mage to create it, because I need some stuff that Mage doesn't support) and in the end sign it.
I'm using an in-house certificate for testing (I created the root CA, and I used it to sign another certificate I made ad hoc for signing the application and ClickOnce.)
I'm using Visual Studio 2012 and SDK tools.
Here is my XYZ.application file:
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xrml="urn:mpeg:mpeg21:2003:01-REL-R-NS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2">
<assemblyIdentity name="XYZ.application" version="1.0.0.11" publicKeyToken="f685d5914ea12e96" language="it" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" />
<description asmv2:publisher="AUTHOR" co.v1:suiteName="AUTHOR" asmv2:product="AUTHOR" asmv2:supportUrl="http://help.AUTHOR.net/" co.v1:errorReportUrl="http://support.AUTHOR.net/" xmlns="urn:schemas-microsoft-com:asm.v1" />
<deployment install="true" disallowUrlActivation="true" mapFileExtensions="true" minimumRequiredVersion="1.0.0.11" co.v1:createDesktopShortcut="true">
<subscription>
<update>
<expiration maximumAge="1" unit="days" />
</update>
</subscription>
<deploymentProvider codebase="http://www.AUTHOR.net/app/XYZ.application" />
</deployment>
<dependency>
<dependentAssembly dependencyType="install" codebase="Application Files\XYZ_1_0_0_11\XYZ.exe.manifest" size="17032">
<assemblyIdentity name="XYZ.exe" version="1.0.0.11" publicKeyToken="f685d5914ea12e96" language="neutral" processorArchitecture="msil" type="win32" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>7YuwliwCxwoquWp3EQf90NMXbg4=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
<framework targetVersion="4.5" profile="Full" supportedRuntime="4.0.30319" />
</compatibleFrameworks>
<publisherIdentity name="..." issuerKeyHash="..." /><Signature Id="StrongNameSignature" xmlns="http://www.w3.org/2000/09/xmldsig#">...SIGNATURE STUFF REMOVED...</Signature></asmv1:assembly>
Here there is the publish.bat batch file (it is not the entire file, just the important stuff).
CALL "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat"
SET PROJECT_NAME=XYZ
SET PROJECT_VERSION=1.0.0.11
SET PROJECT_CSPROJ=%PROJECT_NAME%.csproj
SET PROJECT_PLATFORM=AnyCPU
SET PROJECT_CONFIGURATION=ReleaseForPublish
SET SDK_DIR=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin
SET PROJECT_DIR=PATH_TO_PROJECT_DIR
SET PROJECT_BUILDDIR=%PROJECT_DIR%\bin
SET PROJECT_TARGETDIR=%PROJECT_BUILDDIR%\%PROJECT_CONFIGURATION%
SET PROJECT_TARGETFILENAME=%PROJECT_NAME%.exe
SET PUBLISH_PROCESSOR=msil
SET PUBLISH_DIR=%PROJECT_DIR%\publish
SET PUBLISH_TARGETDIR_BASE=Application Files\%PROJECT_NAME%_%PROJECT_VERSION:.=_%
SET PUBLISH_TARGETDIR=%PUBLISH_DIR%\%PUBLISH_TARGETDIR_BASE%
SET PUBLISH_PROVIDERURL=http://www.AUTHOR.net/app/%PROJECT_NAME%.application
SET PUBLISH_MANIFESTURL=http://www.AUTHOR.net/app/Application Files/%PROJECT_NAME%_%PROJECT_VERSION:.=_%/%PROJECT_NAME%.exe.manifest
SET PUBLISH_SUPPORTURL=http://www.AUTHOR.net/support
SET CERTIFICATE_PATH=%PROJECT_DIR%\_resources\Certificates\codesign.pfx
SET CERTIFICATE_PASSWORD=123456
REM Clean the project
CALL :ExecuteCommand "Cleaning build" "MSBUILD ""%PROJECT_DIR%\%PROJECT_CSPROJ%"" /p:Configuration=""%PROJECT_CONFIGURATION%"" /p:Platform=""%PROJECT_PLATFORM%"" /t:Clean"
REM Build the project
CALL :ExecuteCommand "Building project" "MSBUILD ""%PROJECT_DIR%\%PROJECT_CSPROJ%"" /p:Configuration=""%PROJECT_CONFIGURATION%"" /p:Platform=""%PROJECT_PLATFORM%"" /t:Build"
REM Embed the manifest
CALL :ExecuteCommand "Embedding manifest" """%SDK_DIR%\MT"" -manifest ""%PROJECT_DIR%\_resources\app.manifest"" -outputresource:""%PROJECT_TARGETDIR%\%PROJECT_TARGETFILENAME%;#1"""
REM Sign the assembly
CALL :ExecuteCommand "Signing the assembly" """%SDK_DIR%\SIGNTOOL"" sign /f ""%CERTIFICATE_PATH%"" /p %CERTIFICATE_PASSWORD% /v ""%PROJECT_TARGETDIR%\%PROJECT_TARGETFILENAME%"""
REM Copy the application to the publish folder
CALL :ExecuteCommand "Copying binaries to the publish folder" "XCOPY /E /R /H /Q ""%PROJECT_TARGETDIR%"" ""%PUBLISH_TARGETDIR%"""
REM Create the click once manifest
CALL :ExecuteCommand "Creating click-once application" "MAGE -New Application -name ""%PROJECT_NAME%"" -Version %PROJECT_VERSION% -IconFile ""output.ico"" -TrustLevel FullTrust -UseManifestForTrust true -Publisher ""ADV Network GmbH"" -SupportURL ""%PUBLISH_SUPPORTURL%"" -Processor %PUBLISH_PROCESSOR% -ToFile ""%PUBLISH_TARGETDIR%\%PROJECT_NAME%.exe.manifest"" -FromDirectory ""%PUBLISH_TARGETDIR%"" -CertFile ""%CERTIFICATE_PATH%"" -Password %CERTIFICATE_PASSWORD%"
REM Sign the manifest
CALL :ExecuteCommand "Signing click-once application" "MAGE -Sign ""%PUBLISH_TARGETDIR%\%PROJECT_NAME%.exe.manifest"" -CertFile ""%CERTIFICATE_PATH%"" -Password %CERTIFICATE_PASSWORD%"
REM Update the version and the manifest in the application file
CALL :ExecuteCommand "Updating application deployment [1/2]" "MAGE -Update ""%PUBLISH_DIR%\%PROJECT_NAME%.application"" -Version %PROJECT_VERSION% -Install true -IncludeProviderURL true -ProviderURL ""%PUBLISH_PROVIDERURL%"" -AppManifest ""%PUBLISH_TARGETDIR%\%PROJECT_NAME%.exe.manifest"" -AppCodeBase ""%PUBLISH_TARGETDIR_BASE%\%PROJECT_NAME%.exe.manifest"""
REM Update the min version in the application file
CALL :ExecuteCommand "Updating application deployment [2/2]" "MAGE -Update ""%PUBLISH_DIR%\%PROJECT_NAME%.application"" -MinVersion %PROJECT_VERSION% -CertFile ""%CERTIFICATE_PATH%"" -Password %CERTIFICATE_PASSWORD%"
REM Sign the application
CALL :ExecuteCommand "Signing application deployment" "MAGE -Sign ""%PUBLISH_DIR%\%PROJECT_NAME%.application"" -CertFile ""%CERTIFICATE_PATH%"" -Password %CERTIFICATE_PASSWORD%"
ECHO - Finalizing process
REM Copy the .application inside the target dir
COPY /Y "%PUBLISH_DIR%\%PROJECT_NAME%.application" "%PUBLISH_TARGETDIR%\%PROJECT_NAME%.application" >NUL
REM Add .deploy extension
FOR /r "%PUBLISH_TARGETDIR%" %%i IN (*.*) DO (
IF "%%~xi" NEQ ".manifest" (
IF "%%~xi" NEQ ".application" (
MOVE /Y "%%i" "%%i.deploy" >NUL
)
)
)
This is the error message (in Italian):
INFORMAZIONI VERSIONE PIATTAFORMA (platform informations)
Windows : 6.1.7601.65536 (Win32NT)
Common Language Runtime : 4.0.30319.18052
System.Deployment.dll : 4.0.30319.17929 built by: FX45RTMREL
clr.dll : 4.0.30319.18052 built by: FX45RTMGDR
dfdll.dll : 4.0.30319.17929 built by: FX45RTMREL
dfshim.dll : 4.0.31106.0 (Main.031106-0000)
ORIGINI (sources)
URL distribuzione : file:///PATH_TO_PUBLISH/XYZ.application
URL applicazione : file:///PATH_TO_PUBLISH/Application%20Files/XYZ_1_0_0_11/XYZ.exe.manifest
IDENTITÀ (identity)
Identità distribuzione : XYZ.application, Version=1.0.0.11, Culture=it, PublicKeyToken=f685d5914ea12e96, processorArchitecture=msil
Identità applicazione : XYZ.exe, Version=1.0.0.11, Culture=neutral, PublicKeyToken=f685d5914ea12e96, processorArchitecture=msil, type=win32
RIEPILOGO APPLICAZIONE (application summary)
* Applicazione installabile. (application installable)
RIEPILOGO ERRORI (errors summary)
Quello che segue è un riepilogo degli errori. Informazioni dettagliate su tali errori sono disponibili più avanti nel registro.
* L'attivazione di PATH_TO_PUBLISH\XYZ.application ha causato un'eccezione. Sono stati rilevati i messaggi di errore seguenti:
+ Il riferimento nel manifesto non corrisponde all'identità dell'assembly scaricato XYZ.application.
RIEPILOGO ERRORI TRANSAZIONE ARCHIVIO COMPONENTI (components archive transaction errors summary)
Nessun errore di transazione rilevato. (no errors)
AVVISI (warnings)
Nessun avviso durante l'operazione. (no warnings)
STATO OPERAZIONE (operation state)
* [04/10/2013 10:09:57] : Attivazione di PATH_TO_PUBLISH\XYZ.application avviata.
* [04/10/2013 10:09:57] : Elaborazione del manifesto di distribuzione completata.
* [04/10/2013 10:09:57] : Installazione dell'applicazione avviata.
* [04/10/2013 10:09:58] : Elaborazione del manifesto dell'applicazione completata.
* [04/10/2013 10:10:00] : Trovata una versione Runtime compatibile 4.0.30319.
* [04/10/2013 10:10:00] : Richiesta del trust e rilevamento della piattaforma completati.
DETTAGLI ERRORI (error details)
Durante l'operazione sono stati rilevati gli errori seguenti.
* [04/10/2013 10:10:01] System.Deployment.Application.InvalidDeploymentException (RefDefValidation)
- Il riferimento nel manifesto non corrisponde all'identità dell'assembly scaricato XYZ.application.
- Origine: System.Deployment
- Analisi dello stack:
in System.Deployment.Application.DownloadManager.ProcessDownloadedFile(Object sender, DownloadEventArgs e)
in System.Deployment.Application.FileDownloader.DownloadModifiedEventHandler.Invoke(Object sender, DownloadEventArgs e)
in System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
in System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
in System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
in System.Deployment.Application.DownloadManager.DownloadDependencies(SubscriptionState subState, AssemblyManifest deployManifest, AssemblyManifest appManifest, Uri sourceUriBase, String targetDirectory, String group, IDownloadNotification notification, DownloadOptions options)
in System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
in System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
in System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
in System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
DETTAGLI TRANSAZIONE ARCHIVIO COMPONENTI
Nessuna informazione disponibile sulla transazione.

This problem is caused by not setting the reference in the deployment manifest to the application manifest. Publish it from Visual Studio and then open the .application file (deployment manifest) with MageUI and you'll see the reference to the .exe.manifest (application manifest) in the "Application Files/a_b_c_d" folder (where a_b_c_d is the version). THAT's what you need to be sure you are setting.

Related

Could not load type 'Hangfire.HangfireEndpointRouteBuilderExtensions' from assembly 'Hangfire.AspNetCore when running as a docker container

I am unable to run a docker container with a .NET 5 application that uses Hangfire.
Locally it's all good.
But then I build the image with Azure pipelines, save in Azure Container Registry and try to run it locally. The exception I get is:
Starting app for environment Production
crit: Microsoft.AspNetCore.Hosting.Diagnostics[6]
Application startup exception
System.TypeLoadException: Could not load type 'Hangfire.HangfireEndpointRouteBuilderExtensions' from assembly 'Hangfire.AspNetCore, Version=1.7.18.0, Culture=neutral, PublicKeyToken=null'.
at MyCompany.Platform.Scheduler.WebApi.Startup.<>c.<Configure>b__5_1(IEndpointRouteBuilder endpoints)
at Microsoft.AspNetCore.Builder.EndpointRoutingApplicationBuilderExtensions.UseEndpoints(IApplicationBuilder builder, Action`1 configure)
at MyCompany.Platform.Scheduler.WebApi.Startup.Configure(IApplicationBuilder app, IWebHostEnvironment env) in /home/vsts/work/1/s/src/WebApi/Startup.cs:line 56
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.AspNetCore.Hosting.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder)
at Microsoft.AspNetCore.Hosting.ConfigureBuilder.<>c__DisplayClass4_0.<Build>b__0(IApplicationBuilder builder)
at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c__DisplayClass15_0.<UseStartup>b__1(IApplicationBuilder app)
at Microsoft.AspNetCore.Mvc.Filters.MiddlewareFilterBuilderStartupFilter.<>c__DisplayClass0_0.<Configure>g__MiddlewareFilterBuilder|0(IApplicationBuilder builder)
at Microsoft.AspNetCore.HostFilteringStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app)
at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
Unhandled exception. System.TypeLoadException: Could not load type 'Hangfire.HangfireEndpointRouteBuilderExtensions' from assembly 'Hangfire.AspNetCore, Version=1.7.18.0, Culture=neutral, PublicKeyToken=null'.
at MyCompany.Platform.Scheduler.WebApi.Startup.<>c.<Configure>b__5_1(IEndpointRouteBuilder endpoints)
at Microsoft.AspNetCore.Builder.EndpointRoutingApplicationBuilderExtensions.UseEndpoints(IApplicationBuilder builder, Action`1 configure)
at MyCompany.Platform.Scheduler.WebApi.Startup.Configure(IApplicationBuilder app, IWebHostEnvironment env) in /home/vsts/work/1/s/src/WebApi/Startup.cs:line 56
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.AspNetCore.Hosting.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder)
at Microsoft.AspNetCore.Hosting.ConfigureBuilder.<>c__DisplayClass4_0.<Build>b__0(IApplicationBuilder builder)
at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c__DisplayClass15_0.<UseStartup>b__1(IApplicationBuilder app)
at Microsoft.AspNetCore.Mvc.Filters.MiddlewareFilterBuilderStartupFilter.<>c__DisplayClass0_0.<Configure>g__MiddlewareFilterBuilder|0(IApplicationBuilder builder)
at Microsoft.AspNetCore.HostFilteringStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app)
at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
at MyCompany.Platform.Scheduler.WebApi.Program.Main(String[] args) in /home/vsts/work/1/s/src/WebApi/Program.cs:line 10
This is my Dockerfile
FROM mcr.microsoft.com/dotnet/aspnet:5.0
COPY out .
EXPOSE 80
ENTRYPOINT ["dotnet", "WebApi.dll"]
This is my azure pipelines
trigger:
- master
pool:
vmImage: ubuntu-20.04
variables:
imageName: 'my-scheduler'
stages:
- stage:
displayName: 'Build'
jobs:
- job: 'Build'
displayName: 'Restore and compile'
steps:
- task: UseDotNet#2
displayName: 'Use .NET Core sdk 5.0.x'
inputs:
version: '5.0.x'
includePreviewVersions: true
- script: dotnet restore --no-cache --force
displayName: 'Restore dependencies'
- script: dotnet build --configuration Release --no-restore
displayName: 'Build with Release Configuration'
- script: dotnet vstest test/*FunctionalTests/bin/Release/**/*FunctionalTests.dll
displayName: 'Run functional tests'
- script: dotnet publish -c Release -o out
displayName: 'Publish to folder'
- task: Docker#2
inputs:
containerRegistry: 'saswcr-service-connection'
command: 'login'
- task: Docker#2
inputs:
containerRegistry: 'saswcr-service-connection'
repository: $(imageName)
command: 'buildAndPush'
dockerfile: './Dockerfile'
tags: |
latest
$(Build.BuildNumber)
And this is how I run the container locally after logging into my ACR
docker run --name my-scheduler -p 8080:80 saswcr.azurecr.io/my-scheduler:20201124.4
I'm running out of ideas. The versions of hangfire I use:
<PackageReference Include="Hangfire.AspNetCore" Version="1.7.18" />
<PackageReference Include="Hangfire.Core" Version="1.7.18" />
<PackageReference Include="Hangfire.MemoryStorage" Version="1.7.0" />
Maybe there is something wrong with the image creation, but I cannot think what exactly.
If I do the following to see the contents of my container docker export $(docker ps -lq) | tar tf -
I see:
$ docker export $(docker ps -lq) | tar tf -
.dockerenv
Application.deps.json
Application.dll
Application.pdb
Azure.Core.dll
Azure.Identity.dll
Azure.Security.KeyVault.Certificates.dll
Azure.Security.KeyVault.Secrets.dll
Castle.Core.dll
CodeCoverage/
CodeCoverage/CodeCoverage.config
CodeCoverage/CodeCoverage.exe
CodeCoverage/amd64/
CodeCoverage/amd64/covrun64.dll
CodeCoverage/amd64/msdia140.dll
CodeCoverage/codecoveragemessages.dll
CodeCoverage/covrun32.dll
CodeCoverage/msdia140.dll
FluentAssertions.dll
Hangfire.AspNetCore.dll
Hangfire.Core.dll
Hangfire.MemoryStorage.dll
Hangfire.SqlServer.dll
Infra.Hangfire.deps.json
Infra.Hangfire.dll
Infra.Hangfire.pdb
Microsoft.AspNetCore.Antiforgery.dll
Microsoft.AspNetCore.Authentication.JwtBearer.dll
Microsoft.AspNetCore.Authentication.OpenIdConnect.dll
Microsoft.AspNetCore.Cryptography.Internal.dll
Microsoft.AspNetCore.DataProtection.Abstractions.dll
Microsoft.AspNetCore.DataProtection.dll
Microsoft.AspNetCore.Hosting.Abstractions.dll
Microsoft.AspNetCore.Hosting.Server.Abstractions.dll
Microsoft.AspNetCore.Http.Abstractions.dll
Microsoft.AspNetCore.Http.Extensions.dll
Microsoft.AspNetCore.Http.Features.dll
Microsoft.AspNetCore.Mvc.Testing.dll
Microsoft.AspNetCore.TestHost.dll
Microsoft.AspNetCore.WebUtilities.dll
Microsoft.Bcl.AsyncInterfaces.dll
Microsoft.CodeCoverage.props
Microsoft.CodeCoverage.targets
Microsoft.DotNet.PlatformAbstractions.dll
Microsoft.Extensions.Configuration.Abstractions.dll
Microsoft.Extensions.DependencyInjection.Abstractions.dll
Microsoft.Extensions.DependencyInjection.dll
Microsoft.Extensions.DependencyModel.dll
Microsoft.Extensions.FileProviders.Abstractions.dll
Microsoft.Extensions.FileSystemGlobbing.dll
Microsoft.Extensions.Hosting.Abstractions.dll
Microsoft.Extensions.Logging.Abstractions.dll
Microsoft.Extensions.ObjectPool.dll
Microsoft.Extensions.Options.dll
Microsoft.Extensions.Primitives.dll
Microsoft.Identity.Client.Extensions.Msal.dll
Microsoft.Identity.Client.dll
Microsoft.Identity.Web.UI.Views.dll
Microsoft.Identity.Web.UI.dll
Microsoft.Identity.Web.dll
Microsoft.IdentityModel.JsonWebTokens.dll
Microsoft.IdentityModel.Logging.dll
Microsoft.IdentityModel.Protocols.OpenIdConnect.dll
Microsoft.IdentityModel.Protocols.dll
Microsoft.IdentityModel.Tokens.dll
Microsoft.Net.Http.Headers.dll
Microsoft.OpenApi.dll
Microsoft.TestPlatform.CommunicationUtilities.dll
Microsoft.TestPlatform.CoreUtilities.dll
Microsoft.TestPlatform.CrossPlatEngine.dll
Microsoft.TestPlatform.PlatformAbstractions.dll
Microsoft.TestPlatform.Utilities.dll
Microsoft.VisualStudio.CodeCoverage.Shim.dll
Microsoft.VisualStudio.TestPlatform.Common.dll
Microsoft.VisualStudio.TestPlatform.ObjectModel.dll
Microsoft.VisualStudio.TraceDataCollector.dll
Microsoft.Win32.Registry.dll
Mono.Cecil.Mdb.dll
Mono.Cecil.Pdb.dll
Mono.Cecil.Rocks.dll
Mono.Cecil.dll
Moq.dll
Newtonsoft.Json.dll
NuGet.Frameworks.dll
Swashbuckle.AspNetCore.Swagger.dll
Swashbuckle.AspNetCore.SwaggerGen.dll
Swashbuckle.AspNetCore.SwaggerUI.dll
System.Buffers.dll
System.Configuration.ConfigurationManager.dll
System.Data.SqlClient.dll
System.Diagnostics.DiagnosticSource.dll
System.IdentityModel.Tokens.Jwt.dll
System.Runtime.CompilerServices.Unsafe.dll
System.Security.AccessControl.dll
System.Security.Cryptography.ProtectedData.dll
System.Security.Cryptography.Xml.dll
System.Security.Principal.Windows.dll
System.Text.Encoding.CodePages.dll
System.Text.Encodings.Web.dll
System.Threading.dll
UseCases/
UseCases/AddJob/
UseCases/AddJob/simple_job.json
UseCases/AddJob/simple_job_with_url_parameters.json
WebApi
WebApi.FunctionalTests.deps.json
WebApi.FunctionalTests.dll
WebApi.FunctionalTests.pdb
WebApi.FunctionalTests.runtimeconfig.json
WebApi.deps.json
WebApi.dll
WebApi.pdb
WebApi.runtimeconfig.json
appsettings.Development.json
appsettings.Local.json
appsettings.Production.json
appsettings.Qa.json
appsettings.Test.json
appsettings.json
bin/
etc.
The line that seems to be causing the issue is:
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
endpoints
.MapHangfireDashboard(HangfireConstants.DashboardUrl)
.RequireAuthorization(PolicyConstants.DashboardPolicy);
});
What could be the reason? And why does it happen in docker container and not outside?
UPDATE 1 2020-11-24:
Interesting finding. I've generated a docker image for the same code, only this time using GitLab CI, Gitlab container repository and kaniko (I'm more familiar with this approach than Azure DevOps) as follows:
default:
image: mcr.microsoft.com/dotnet/sdk:5.0
variables:
PUBLISH_OUTPUT_DIR: publish
ENTRYPOINT_DLL: WebApi.dll
WEB_APP_HOOK: $WEB_APP_HOOK
stages:
- build
- test
- publish
- delivery
- release
build:
stage: build
script:
- dotnet restore --no-cache --force
- dotnet build -c Release --no-restore
artifacts:
paths:
- test
expire_in: 1 hour
unit_tests:
stage: test
script: dotnet vstest test/*UnitTests/bin/Release/**/*UnitTests.dll --Blame
rules:
- exists:
- test/*UnitTests/*UnitTests.csproj
functional_tests:
stage: test
script: dotnet vstest test/*FunctionalTests/bin/Release/**/*FunctionalTests.dll --Blame
rules:
- exists:
- test/*FunctionalTests/*FunctionalTests.csproj
publish:
stage: publish
script:
- dotnet publish -c Release -o $PUBLISH_OUTPUT_DIR
artifacts:
paths:
- publish/
expire_in: 1 hour
build_image:
stage: delivery
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
before_script:
- echo "Generating $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"
- echo "FROM mcr.microsoft.com/dotnet/aspnet:5.0" > $CI_PROJECT_DIR/Dockerfile
- echo "COPY $PUBLISH_OUTPUT_DIR ." >> $CI_PROJECT_DIR/Dockerfile
- echo "EXPOSE 80" >> $CI_PROJECT_DIR/Dockerfile
- echo "ENTRYPOINT [\"dotnet\", \"$ENTRYPOINT_DLL\"]" >> $CI_PROJECT_DIR/Dockerfile
# #see https://github.com/GoogleContainerTools/kaniko/issues/1227
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- echo "Displaying files.."
- cat $CI_PROJECT_DIR/Dockerfile
- cat /kaniko/.docker/config.json
script:
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
Then I run the container as:
docker run --name cubic-scheduler -p 8080:80 registry.gitlab.com/cubictelecom/my-scheduler
This time, with this way of creating the docker image, it works fine. So it seems the problem is indeed with how the docker image is created. But what's the problem exactly and why it has such an effect on hangfire?
UPDATE 2 2020-11-24:
Dependencies are as follows:
WebApi
<ItemGroup>
<PackageReference Include="Microsoft.Identity.Web" Version="1.3.0" />
<PackageReference Include="Microsoft.Identity.Web.UI" Version="1.3.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Application\Application.csproj" />
<ProjectReference Include="..\Infra.Hangfire\Infra.Hangfire.csproj" />
</ItemGroup>
Application
no dependencies.
Infra.Hangfire
<ItemGroup>
<PackageReference Include="Hangfire.AspNetCore" Version="1.7.18" />
<PackageReference Include="Hangfire.Core" Version="1.7.18" />
<PackageReference Include="Hangfire.MemoryStorage" Version="1.7.0" />
<PackageReference Include="Hangfire.SqlServer" Version="1.7.18" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Application\Application.csproj" />
</ItemGroup>
As you can see, there is no conflict in versions as it uses a clean architecture approach where all the third party dependencies are in infra layer (and web api). In any case, it works fine locally, and it works fine as a docker container when creating it with kaniko and gitlab. The problem must be in how I create it for Azure DevOps.

Clickonce application wont install

I am having winform application which is deployed with ClickOnce publisher.
I publish my application to local PC, then transfer files (setup, manifest and version folder from Application Files folder inside) to my Windows Server 2003 and then there I start setup.
I have deployed 168 versions of it and it worked normally but today it stopped working.
What I mean by that is when I start SETUP it just starts it and nothing happens.
I have started TASK MANAGER and inside It I see MyApplicationName.exe starts but also what I see is Dw20.exe (if it is important).
I have tried publishing another time (new version) but same happens.
Since it is not starting from setup file I went to Application Files/1_0_0_X and started manifest file from there and then error window appears which says:
Application download didn't succeed....
and in Details.. I have this log:
PLATFORM VERSION INFO
Windows : 5.2.3790.131072 (Win32NT)
Common Language Runtime : 4.0.30319.1
System.Deployment.dll : 4.0.30319.1 (RTMRel.030319-0100)
clr.dll : 4.0.30319.1 (RTMRel.030319-0100)
dfdll.dll : 4.0.30319.1 (RTMRel.030319-0100)
dfshim.dll : 4.0.31106.0 (Main.031106-0000)
SOURCES
Deployment url : file:///C:/Program%20Files/Magacin/Application%20Files/Magacin_1_0_0_170/Magacin.application
Deployment Provider url : http://desktop-i40i5hu/Magacin/Magacin.application
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of C:\Program Files\Magacin\Application Files\Magacin_1_0_0_170\Magacin.application resulted in exception. Following failure messages were detected:
+ Downloading http://desktop-i40i5hu/Magacin/Magacin.application did not succeed.
+ The remote name could not be resolved: 'desktop-i40i5hu'
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
There were no warnings during this operation.
OPERATION PROGRESS STATUS
* [20.09.2018 15:20:10] : Activation of C:\Program Files\Magacin\Application Files\Magacin_1_0_0_170\Magacin.application has started.
ERROR DETAILS
Following errors were detected during this operation.
* [20.09.2018 15:20:13] System.Deployment.Application.DeploymentDownloadException (Unknown subtype)
- Downloading http://desktop-i40i5hu/Magacin/Magacin.application did not succeed.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
at System.Deployment.Application.DownloadManager.DownloadManifestAsRawFile(Uri& sourceUri, String targetPath, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestDirect(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
at System.Deployment.Application.DownloadManager.FollowDeploymentProviderUri(SubscriptionStore subStore, AssemblyManifest& deployment, Uri& sourceUri, TempFile& tempFile, IDownloadNotification notification, DownloadOptions options)
at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
--- Inner Exception ---
System.Net.WebException
- The remote name could not be resolved: 'desktop-i40i5hu'
- Source: System
- Stack trace:
at System.Net.HttpWebRequest.GetResponse()
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.
Since I saw this message The remote name could not be resolved: 'desktop-i40i5hu' I went to check which PC is desktop-i40i5hu and I came up that it is my local pc (One that I am developing app in) so I thought that is problem BUT when I went to manifest file from 30 versions ago, it has same configuration and it is also mentioned this pc name and it worked normally.
What could possibly be the problem here?
My manifest file:
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xrml="urn:mpeg:mpeg21:2003:01-REL-R-NS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2">
<assemblyIdentity name="Magacin.application" version="1.0.0.171" publicKeyToken="7c841f97b6f4e6dd" language="neutral" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" />
<description asmv2:publisher="Magacin" asmv2:product="Magacin" xmlns="urn:schemas-microsoft-com:asm.v1" />
<deployment install="true" mapFileExtensions="true">
<deploymentProvider codebase="http://desktop-i40i5hu/Magacin/Magacin.application" />
</deployment>
<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
<framework targetVersion="4.0" profile="Full" supportedRuntime="4.0.30319" />
</compatibleFrameworks>
<dependency>
<dependentAssembly dependencyType="install" codebase="Application Files\Magacin_1_0_0_171\Magacin.exe.manifest" size="17270">
<assemblyIdentity name="Magacin.exe" version="1.0.0.171" publicKeyToken="7c841f97b6f4e6dd" language="neutral" processorArchitecture="msil" type="win32" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>rAGYfZ9qSVQRPuG5wA0Z5LpiXiw=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
<publisherIdentity name="CN=DESKTOP-1VBU9II\arist" issuerKeyHash="fe4200ba8b6dbe28648e23c775f06fa5ae24f327" /><Signature Id="StrongNameSignature" xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /><Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><DigestValue>2qtxvGAyieS+/aFm11SpiFuvfB8=</DigestValue></Reference></SignedInfo><SignatureValue>EEW8FQAdOEK8gnSfzfwKxbbEUpRxF2bQ1g0zAQZqfzUNHYYbYfFuuJSaQG/H0/eQrwTm+ZkTgbzHaEQ9Ws/nHH+HnXRLP8JaL3VQKfZJCgqZgR4by2y/ShqWR529f+QkuHFgWgZa5HbJoqg0Qbudn+tBltHIFgDGQfGHMVFWiEo=</SignatureValue><KeyInfo Id="StrongNameKeyInfo"><KeyValue><RSAKeyValue><Modulus>1UHNMvkLBxDsocHDOsb0/lpgXi0zrit5zD9an7vz5uuwDbG4n6j0BBJVi6oaUHBEB1QxL4DfirBbeJUpE5+pmswg/ybnFjD2l2VE93J6IMyyAiWx5RqNfrf0e0IuaspmgMoEi2MScmHKu+H5We0ECBhMyB6S+JvVvF4LFBgFcEk=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue></KeyValue><msrel:RelData xmlns:msrel="http://schemas.microsoft.com/windows/rel/2005/reldata"><r:license xmlns:r="urn:mpeg:mpeg21:2003:01-REL-R-NS" xmlns:as="http://schemas.microsoft.com/windows/pki/2005/Authenticode"><r:grant><as:ManifestInformation Hash="1f7caf5b88a954d766a1fdbee4893260bc71abda" Description="" Url=""><as:assemblyIdentity name="Magacin.application" version="1.0.0.171" publicKeyToken="7c841f97b6f4e6dd" language="neutral" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" /></as:ManifestInformation><as:SignedBy /><as:AuthenticodePublisher><as:X509SubjectName>CN=DESKTOP-1VBU9II\arist</as:X509SubjectName></as:AuthenticodePublisher></r:grant><r:issuer><Signature Id="AuthenticodeSignature" xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /><Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><DigestValue>B+tpk5gCS54I1V73fzPct5OPdDU=</DigestValue></Reference></SignedInfo><SignatureValue>gRIzJFslS3kwWhE2ttwVhI6Sp6GZpQ18GaVXlk8P8fcLsnPfUWkIG+hUZ2/bEhaXHa54n6+Eloaqf5we64r0zvqL+k6DGZp+u6kXVGmoVN7myvLC+9RER+KvDhaGoCqQRZakGsQALzH9R8Abb3wavGVqiY+GWdWwtBTyY37jCpc=</SignatureValue><KeyInfo><KeyValue><RSAKeyValue><Modulus>1UHNMvkLBxDsocHDOsb0/lpgXi0zrit5zD9an7vz5uuwDbG4n6j0BBJVi6oaUHBEB1QxL4DfirBbeJUpE5+pmswg/ybnFjD2l2VE93J6IMyyAiWx5RqNfrf0e0IuaspmgMoEi2MScmHKu+H5We0ECBhMyB6S+JvVvF4LFBgFcEk=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue></KeyValue><X509Data><X509Certificate>MIIB7TCCAVagAwIBAgIQNo9sFB5oMLdIxe2hijch8zANBgkqhkiG9w0BAQUFADA1MTMwMQYDVQQDHioARABFAFMASwBUAE8AUAAtADEAVgBCAFUAOQBJAEkAXABhAHIAaQBzAHQwHhcNMTcxMjEyMTY1NzA1WhcNMTgxMjEyMjI1NzA1WjA1MTMwMQYDVQQDHioARABFAFMASwBUAE8AUAAtADEAVgBCAFUAOQBJAEkAXABhAHIAaQBzAHQwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANVBzTL5CwcQ7KHBwzrG9P5aYF4tM64recw/Wp+78+brsA2xuJ+o9AQSVYuqGlBwRAdUMS+A34qwW3iVKROfqZrMIP8m5xYw9pdlRPdyeiDMsgIlseUajX639HtCLmrKZoDKBItjEnJhyrvh+VntBAgYTMgekvib1bxeCxQYBXBJAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEANvRVpqrbhZSSrEOTTNq0DLXsn+l5q5XWrFqHUX1C9bNvYGiDEehp504nJKSd5fZSmHrUfALiJ1bDox/VUzL7AvIGsIMw2+ysbffsoLJTTntWY0dag5YkGzn16DtWScvT1sBiZ0h6q9qPVuprBCMOjMK2SEKeLGsIIaw7h10ZjvQ=</X509Certificate></X509Data></KeyInfo></Signature></r:issuer></r:license></msrel:RelData></KeyInfo></Signature></asmv1:assembly>
Looks like problem isn't this.
I have commented sections of my code to see where is it making problem and came up that this started making problem:
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
I do not know why but I will as other question for this.

In Linux, when I use nuget pack, it raise "Cannot create a package"

here is my [full code](https://github.com/roroco/nuget-pack-raise-cannot-create-err), I only use following code:
//Ro/Dep/TestNuget.cs
namespace Dep
{
public class TestNuget
{
}
}
and following Dep.nuspec
<?xml version="1.0"?>
<package >
<metadata>
<id>Ro.Dep</id>
<version>1.0</version>
<title>Dep</title>
<authors>roroco</authors>
<owners>roroco</owners>
<licenseUrl>http://LICENSE_URL_HERE_OR_DELETE_THIS_LINE</licenseUrl>
<projectUrl>http://PROJECT_URL_HERE_OR_DELETE_THIS_LINE</projectUrl>
<iconUrl>http://ICON_URL_HERE_OR_DELETE_THIS_LINE</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>prpr</description>
<releaseNotes>Summary of changes made in this release of the package.</releaseNotes>
<copyright>Copyright 2017</copyright>
<tags>Tag1 Tag2</tags>
</metadata>
</package>
when I do following and raise err:
roroco#roroco ~/Downloads/test/cs/create-nuget-dep-and-use-it/Dep $ nuget pack -Verbosity detailed Dep.nuspec
Attempting to build package from 'Dep.nuspec'.
System.InvalidOperationException: Cannot create a package that has no dependencies nor content.
at NuGet.PackageBuilder.Save (System.IO.Stream stream) [0x0005b] in <0800978c21b14124ab3d9821cb98ed45>:0
at NuGet.Commands.PackCommand.BuildPackage (NuGet.PackageBuilder builder, System.String outputPath) [0x00088] in <e3902586c3ab4cf69b6ed7a8d575962f>:0
at NuGet.Commands.PackCommand.BuildFromNuspec (System.String path) [0x00054] in <e3902586c3ab4cf69b6ed7a8d575962f>:0
at NuGet.Commands.PackCommand.BuildPackage (System.String path) [0x00013] in <e3902586c3ab4cf69b6ed7a8d575962f>:0
at NuGet.Commands.PackCommand.ExecuteCommand () [0x000a5] in <e3902586c3ab4cf69b6ed7a8d575962f>:0
at NuGet.Commands.Command.Execute () [0x000ca] in <e3902586c3ab4cf69b6ed7a8d575962f>:0
at NuGet.Program.Main (System.String[] args) [0x0018b] in <e3902586c3ab4cf69b6ed7a8d575962f>:0
here is my env:
roroco#roroco ~/Downloads/test/cs/create-nuget-dep-and-use-it/Dep $ lsb_release -a
No LSB modules are available.
Distributor ID: LinuxMint
Description: Linux Mint 18 Sarah
Release: 18
Codename: sarah
NuGet Version: 2.12.0.0
I find the solution, sudo apt install nuget -y install nuget 2, when i download latest nuget.exe(4.1.0), and run mono path/to/nuget.exe pack, it work

Unable to Uninstall WiX Managed Bootstrapper application from another Managed Bootstrapper Application

I have my own Managed Bootstrapper Application developed using WiX Toolset and written in c# using MVVM pattern. As this is a Managed Bootstrapper Application, i have a custom UI as well. My Bundle.wxs Code is as follows
<Bundle Name="NestleMESSetup"
Version="!(bind.packageVersion.NestleCustomLayerSetupPackage)"
Manufacturer="CT Infotech"
UpgradeCode="CCBB8D5B-8171-47FB-AD53-25C6E866C34E"
Copyright="Copyright© 2017 CT Infotech ALL RIGHTS RESERVED"
SplashScreenSourceFile="Resources\Splash.bmp"
IconSourceFile="Resources\menu.ico">
<Variable Name="KambanVersion" Type="version" Value="!(bind.packageVersion.KambanFASSetup)"/>
<BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost">
<PayloadGroupRef Id="InstallerPayload"/>
</BootstrapperApplicationRef>
<util:RegistrySearchRef Id='SearchForKamban' />
<Chain>
<PackageGroupRef Id="InstallerPackages"/>
</Chain>
<Variable Name="DbName" bal:Overridable="yes" />
<Variable Name="SqlInstance" bal:Overridable="yes" />
<Variable Name="InstallPath" bal:Overridable="yes" />
<Variable Name="Roles" bal:Overridable="yes" />
<Variable Name="Modules" bal:Overridable="yes" />
<Variable Name="CustomInstall" bal:Overridable="yes"/>
<WixVariable Id="WixMbaPrereqPackageId" Value="Netfx4Full" />
<WixVariable Id="WixMbaPrereqLicenseUrl" Value="NetfxLicense.rtf" />
</Bundle>
<Fragment>
<PayloadGroup Id="InstallerPayload">
<Payload SourceFile="..\Nestle.MES.Bootstrapper.UI\BootstrapperCore.config"/>
<Payload SourceFile="..\Nestle.MES.Bootstrapper.UI\bin\$(var.Configuration)\Nestle.MES.Bootstrapper.UI.dll"/>
<Payload SourceFile="C:\Program Files (x86)\WiX Toolset v3.10\SDK\Microsoft.Deployment.WindowsInstaller.dll"/>
</PayloadGroup>
</Fragment>
<Fragment>
<PackageGroup Id="InstallerPackages">
<RollbackBoundary Id="StartingPoint" Vital="yes" />
<ExePackage Id="KambanFASSetup" Cache="no" Compressed="yes" Vital="yes" Permanent="no" Name="KambanCoreSetup"
SourceFile="..\..\Kamban.FAS.Setup_Source\$(var.Configuration)\KambanFASSetup.exe" >
<CommandLine InstallArgument="[SqlInstance]" Condition="1" />
<CommandLine InstallArgument="[DbName]" Condition="1"/>
<CommandLine InstallArgument="[InstallPath]" Condition="1"/>
<CommandLine InstallArgument="[Roles]" Condition="1"/>
<CommandLine InstallArgument="[Modules]" Condition="1" />
<CommandLine InstallArgument="[CustomInstall]" Condition="1"/>
</ExePackage>
<MsiPackage SourceFile="..\..\build_folder\$(var.Configuration)\Nestle.MES.CustomLayer\Nestle.MES.CustomLayerSetup.msi"
Id="NestleCustomLayerSetupPackage" Cache="yes" Visible="no" Compressed="yes" EnableFeatureSelection="yes" Vital="yes">
<MsiProperty Name="INSTALLFOLDER" Value="[INSTALLFOLDER]" />
<MsiProperty Name="VERSION" Value="[VERSION]"/>
<MsiProperty Name="ADDLOCAL" Value="[NestleFeatures]" />
</MsiPackage>
</PackageGroup>
</Fragment>
<Fragment>
<util:RegistrySearch
Id='SearchForKamban'
Variable="KambanInstalled"
Result="exists"
Root="HKLM"
Key="SOFTWARE\Wow6432Node\KambanFAS" />
<bal:Condition Message="Product already Exists">
KambanInstalled
</bal:Condition>
</Fragment>
In the above code, you can see that I have an MsiPackage and an ExePackage in my Bundle chain. The ExePackage with Id="KambanFASSetup" is also a Managed Bootstrapper Application with its very own custom UI. Once I install this Parent bundle exe, i get two entries in my Programs and Features. I believe this is because i have two managed bootstrapper exe. So now while uninstalling the NestleMESSetup only my MsiPackage is getting uninstaled and my ExePackage doesnt. But my requirement is as follows
The ExePackage should also be uninstalled if I uninstall the Parent Exe.
The Uninstallation of the Child ExePackage must happen silently. i.e
It's UI should NOT be shown prompting the user to click the Uninstall
button again.
Please let me know if more info is needed.Any help on this would be much appreciated.
Edit1:
Here is the Uninstall logs in %temp% folder
[2658:3330][2017-05-19T19:27:11]i001: Burn v3.10.2.2516, Windows v6.1 (Build 7601: Service Pack 1), path: C:\ProgramData\Package Cache\{a21ebf3e-08b2-4b64-b5bf-38dccfea21a2}\Nestle.MES.Setup.exe
[2658:3330][2017-05-19T19:27:11]i000: Initializing version variable 'KambanVersion' to value '1.0.647.0'
[2658:3330][2017-05-19T19:27:11]i009: Command Line: '/uninstall'
[2658:3330][2017-05-19T19:27:11]i000: Setting string variable 'WixBundleLog' to value 'C:\Users\RAJASA~1.000\AppData\Local\Temp\NestleMESSetup_20170519192711.log'
[2658:3330][2017-05-19T19:27:11]i000: Setting string variable 'WixBundleManufacturer' to value 'CT Infotech'
[2658:3330][2017-05-19T19:27:11]i000: Loading managed bootstrapper application.
[2658:3330][2017-05-19T19:27:11]i000: Creating BA thread to run asynchronously.
[2658:3330][2017-05-19T19:27:11]i100: Detect begin, 2 packages
[2658:3330][2017-05-19T19:27:11]i000: Setting numeric variable 'KambanInstalled' to value 1
[2658:3330][2017-05-19T19:27:11]i101: Detected package: KambanFASSetup, state: Absent, cached: None
[2658:3330][2017-05-19T19:27:11]i101: Detected package: NestleCustomLayerSetupPackage, state: Present, cached: Complete
[2658:3330][2017-05-19T19:27:11]i104: Detected package: NestleCustomLayerSetupPackage, feature: AppFeatures, state: Local
[2658:3330][2017-05-19T19:27:11]i104: Detected package: NestleCustomLayerSetupPackage, feature: WebFeatures, state: Local
[2658:3330][2017-05-19T19:27:11]i104: Detected package: NestleCustomLayerSetupPackage, feature: DbFeatures, state: Local
Edit2:
With the Detect Condition added to my Bundle chain Exe package I am not able to Uninstall the Parent exe as well. The WiX logs are as follows
[1450:1BBC][2017-05-20T07:33:59]i371: Updating session, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{c8fb8ef8-905f-4bd9-8675-91f62d83e5c8}, resume: Active, restart initiated: No, disable resume: No
[1644:0F04][2017-05-20T07:33:59]w341: Prompt for source of container: WixAttachedContainer, path: E:\TFS_Nestle\Nestle\build_folder\Debug\Nestle.MES.Setup\Nestle.MES.Setup.exe
[1644:0F04][2017-05-20T07:33:59]e054: Failed to resolve source for file: E:\TFS_Nestle\Nestle\build_folder\Debug\Nestle.MES.Setup\Nestle.MES.Setup.exe, error: 0x80070002.
[1644:0F04][2017-05-20T07:33:59]e000: Error 0x80070002: Failed while prompting for source (original path 'E:\TFS_Nestle\Nestle\build_folder\Debug\Nestle.MES.Setup\Nestle.MES.Setup.exe'). [1644:0F04][2017-05-20T07:33:59]e311: Failed to acquire container: WixAttachedContainer to working path: C:\Users\RAJASA~1.000\AppData\Local\Temp\{B5BE6652-F453-40B5-A2BF-6313B191EA7F}\9FD1B9E707102B3EB2E75EA87962C5C839E9588A, error: 0x80070002.
[1644:1B24][2017-05-20T07:33:59]e000: Error 0x80070002: Failed while caching, aborting execution.
[1450:1BBC][2017-05-20T07:33:59]i372: Session end, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{c8fb8ef8-905f-4bd9-8675-91f62d83e5c8}, resume: ARP, restart: None, disable resume: No
[1450:1BBC][2017-05-20T07:33:59]i371: Updating session, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{c8fb8ef8-905f-4bd9-8675-91f62d83e5c8}, resume: ARP, restart initiated: No, disable resume: No
[1644:1B24][2017-05-20T07:33:59]i399: Apply complete, result: 0x80070002, restart: None, ba requested restart: No
[1644:1B24][2017-05-20T07:33:59]i500: Shutting down, exit code: 0x0
Your ExePackage is missing the UninstallCommand attribute so burn does not know how to properly uninstall it. It should be something like
UninstallCommand="/uninstall /quiet"
and may be some additions if needed.
And for burn to be able to detect the ExePackage, it should define the attribute DetectCondition. Something like
DetectCondition="KambanInstalled"

Deploy ClickOnce on Windows XP

I'm trying to install my C# application on a clean Windows XP machine. The program needs .NET Framework 3.5, so I added that in the prerequisites. The application works perfectly fine on Windows 7 machines, but it fails with Windows XP and gives me the following error:
ERROR DETAILS
Following errors were detected during this operation.
* [3/14/2013 11:11:26 AM] System.Deployment.Application.InvalidDeploymentException (ManifestParse)
- Exception reading manifest from file://tsclient/D/publish/Application%20Files/LivePigeonClient_1_0_0_16/LivePigeonClient.application: the manifest may not be valid or the file could not be opened.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)
at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestDirectBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
--- Inner Exception ---
System.Deployment.Application.InvalidDeploymentException (SignatureValidation)
- Manifest XML signature is not valid.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.Manifest.AssemblyManifest.ValidateSignature(Stream s)
at System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)
--- Inner Exception ---
System.Security.Cryptography.CryptographicException
- SignatureDescription could not be created for the signature algorithm supplied.
- Source: System.Security
- Stack trace:
at System.Security.Cryptography.Xml.SignedXml.CheckSignedInfo(AsymmetricAlgorithm key)
at System.Security.Cryptography.Xml.SignedXml.CheckSignatureReturningKey(AsymmetricAlgorithm& signingKey)
at System.Deployment.Internal.CodeSigning.SignedCmiManifest.Verify(CmiManifestVerifyFlags verifyFlags)
at System.Deployment.Application.Manifest.AssemblyManifest.ValidateSignature(Stream s)
An InvalidDeploymentException (SignatureValidation)
What is causing this problem?
Application manifest
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xrml="urn:mpeg:mpeg21:2003:01-REL-R-NS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2">
<assemblyIdentity name="LivePigeonClient.application" version="1.0.0.16" publicKeyToken="9c18f07266746296" language="neutral" processorArchitecture="x86" xmlns="urn:schemas-microsoft-com:asm.v1" />
<description asmv2:publisher="LivePigeonClient" asmv2:product="LivePigeonClient" xmlns="urn:schemas-microsoft-com:asm.v1" />
<deployment install="true" mapFileExtensions="true" co.v1:createDesktopShortcut="true">
<deploymentProvider codebase="http://nb-stage/LivePigeonClient/LivePigeonClient.application" />
</deployment>
<dependency>
<dependentAssembly dependencyType="install" codebase="Application Files\LivePigeonClient_1_0_0_16\LivePigeonClient.exe.manifest" size="19770">
<assemblyIdentity name="LivePigeonClient.exe" version="1.0.0.16" publicKeyToken="9c18f07266746296" language="neutral" processorArchitecture="x86" type="win32" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>YcOGziTuwXQ5l5/mkvEF3puhg/M=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
<publisherIdentity name="CN=VANHULTEN\max" issuerKeyHash="ba68cf2261b7dec8653727cbceeb3f0f3817bb37" /><Signature Id="StrongNameSignature" xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha256" /><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /><Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" /><DigestValue>aYws5APsQnYt1TNpwaT6ZcoySBiM+HBSH7d0l8/FEmE=</DigestValue></Reference></SignedInfo><SignatureValue>vm7Tjd/SFZK0WT1YGgEqWP6QOgJ3U26D/+32LrxmjMysNlfuJ21MjAmjiP3Hcd4fuDX6QJ7ctH4+Vrlx+kXrrfnVcceBbhAAph4uosfo8qKpwCHbfp/J0leQ3DzT61Sd4EE//wZW6qJcpgW8qqn/id7AH/jAcCbrpOIufLXc7yU=</SignatureValue><KeyInfo Id="StrongNameKeyInfo"><KeyValue><RSAKeyValue><Modulus>wj4ZM4ud3sPlAxopNQiYHeg4fg+3TSEHWIWrjNV47F3KePb+nOtYblz7nEzplq5HPmX5gyoauqpmelyB453l5N6Hd6WfHuyZpQB6ESxVuiI9XS3L/WXMrazRj2EeExnpEdslVJx32lInreg/rwDHz59fOP1G+hKnzgoO8ViAgGU=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue></KeyValue><msrel:RelData xmlns:msrel="http://schemas.microsoft.com/windows/rel/2005/reldata"><r:license xmlns:r="urn:mpeg:mpeg21:2003:01-REL-R-NS" xmlns:as="http://schemas.microsoft.com/windows/pki/2005/Authenticode"><r:grant><as:ManifestInformation Hash="6112c5cf9774b71f5270f88c184832ca65faa4c16933d52d7642ec03e42c8c69" Description="" Url=""><as:assemblyIdentity name="LivePigeonClient.application" version="1.0.0.16" publicKeyToken="9c18f07266746296" language="neutral" processorArchitecture="x86" xmlns="urn:schemas-microsoft-com:asm.v1" /></as:ManifestInformation><as:SignedBy /><as:AuthenticodePublisher><as:X509SubjectName>CN=VANHULTEN\max</as:X509SubjectName></as:AuthenticodePublisher></r:grant><r:issuer><Signature Id="AuthenticodeSignature" xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha256" /><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /><Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" /><DigestValue>CdT1rv1rwUXqtJn0L3bDBoocdBFyTmyn0kcJMsw0Ioo=</DigestValue></Reference></SignedInfo><SignatureValue>d/fsB1cfPn+29iEB3ltgkoQ4HE2T/wxQzJAhKIxCDM6oZLjNnvATM2stOvWs8nvdINFQEtef19aMjaYIAu9E00oncYvy+Sxv+qtNM2AEpTkRKQTrWHCR7DymiK4JPRmT+ixKwNCWwxMIl6LL/12f7o57COd+5cM1+FfgC6ew5TU=</SignatureValue><KeyInfo><KeyValue><RSAKeyValue><Modulus>wj4ZM4ud3sPlAxopNQiYHeg4fg+3TSEHWIWrjNV47F3KePb+nOtYblz7nEzplq5HPmX5gyoauqpmelyB453l5N6Hd6WfHuyZpQB6ESxVuiI9XS3L/WXMrazRj2EeExnpEdslVJx32lInreg/rwDHz59fOP1G+hKnzgoO8ViAgGU=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue></KeyValue><X509Data><X509Certificate>MIIBzTCCATagAwIBAgIQHYBpoynYcYpB1zAtPuky+zANBgkqhkiG9w0BAQsFADAlMSMwIQYDVQQDHhoAVgBBAE4ASABVAEwAVABFAE4AXABtAGEAeDAeFw0xMzAyMjgxMDAyNThaFw0xNDAyMjgxNjAyNThaMCUxIzAhBgNVBAMeGgBWAEEATgBIAFUATABUAEUATgBcAG0AYQB4MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDCPhkzi53ew+UDGik1CJgd6Dh+D7dNIQdYhauM1XjsXcp49v6c61huXPucTOmWrkc+ZfmDKhq6qmZ6XIHjneXk3od3pZ8e7JmlAHoRLFW6Ij1dLcv9ZcytrNGPYR4TGekR2yVUnHfaUiet6D+vAMfPn184/Ub6EqfOCg7xWICAZQIDAQABMA0GCSqGSIb3DQEBCwUAA4GBAGIPyDRw+3ORyEMFenNwwOKY2pb5XJ4+VfWZ1qsajyvEOxhQRIsQc04XhSeTLqa2hWumXHSQ/GgKMf4cR03cMBRwIVQxY03YmnoiLxqfkbzSAQMLrSKp7jychp+oODkuIKBruLdNLB/xlAv09dJac28sUG6p+8uAObL9HZDkhgr6</X509Certificate></X509Data></KeyInfo></Signature></r:issuer></r:license></msrel:RelData></KeyInfo></Signature></asmv1:assembly>
Does the Windows XP machine have SP-3 installed, and all of the windows updates? ALso, is .NET 3.5 installed?
Change the Signature Algorithm. Right click Project-> Properties-> Signing, re-select or recreate the certificate. After that the Signature Algorithm will change to sha1RSA.
http://social.msdn.microsoft.com/Forums/windows/en-US/f5b934d2-e8b9-4401-b038-b84aefbdf836/clickonce-exception-reading-manifest?forum=winformssetup

Categories

Resources