Publishing the Crawler-Lib Engine in a ClickOnce Application

Posted: 3 years ago Quote #80
I'm using the community edition of Crawler-Lib in my C# app and have included the license in the project and marked the file with a BuildAction of Content. The license exists in my Debug/app.publish folder and the publish goes fine. However, when I install from the web with ClickOnce it chokes. Do I need the paid version in order to publish successfully, or am I missing a setting someplace? I was just wanting to run it on another computer on my network and ClickOnce is great because it auto-updates the app. The error I'm getting is as follows:

  Following errors were detected during this operation.
  * [1/11/2015 9:27:22 PM] System.Deployment.Application.InvalidDeploymentException (ManifestLoad)
    – Exception occurred loading manifest from file CrawlerLib.Engine.dll: the manifest may not be valid or the file could not be opened.
    – Source: System.Deployment
    – Stack trace:
      at System.Deployment.Application.Manifest.AssemblyManifest.LoadFromInternalManifestFile(String filePath)
      at System.Deployment.Application.DownloadManager.ProcessDownloadedFile(Object sender, DownloadEventArgs e)
      at System.Deployment.Application.FileDownloader.DownloadModifiedEventHandler.Invoke(Object sender, DownloadEventArgs e)
      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.DownloadDependencies(SubscriptionState subState, AssemblyManifest deployManifest, AssemblyManifest appManifest, Uri sourceUriBase, String targetDirectory, String group, IDownloadNotification notification, DownloadOptions options)
      at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
      at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
      at System.Deployment.Application.ApplicationActivator.ConsumeUpdatedDeployment(SubscriptionState& subState, ActivationDescription actDesc)
      at System.Deployment.Application.ApplicationActivator.PerformDeploymentUpdate(SubscriptionState& subState, String& errorPageUrl)
      at System.Deployment.Application.ApplicationActivator.ProcessOrFollowShortcut(String shortcutFile, String& errorPageUrl, TempFile& deployFile)
      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.DeploymentException (InvalidManifest)
    – Cannot load internal manifest from component file.
    – Source:
    – Stack trace:

Any information would be helpful.

PS  Thank Tom for the awesome help with my project!
Posted: 3 years ago Quote #81
This is the dependency entry from the manifest if it helps at all:

    <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="CrawlerLib.Engine.dll" size="428544">
      <assemblyIdentity name="CrawlerLib.Engine" version="2.1.5296.19510" language="neutral" processorArchitecture="msil" />
          <dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
        <dsig:DigestMethod Algorithm="" />

If I uninstall the Crawler-Lib reference then everything publishes & installs without any problems.
Posted: 3 years ago Quote #82
Hi Pete, the community edition and unlimited edition have no difference in deployment. We haven't tested ClickOnce deployment yet, but I start investigating this issue now. Best regards Tom.
Crawler-Lib Developer
Posted: 3 years ago Quote #83
Hello Peter, the error is caused by the licensing system we are using. We have fixed this already internally. The Crawler-Lib Engine build is triggered on the build server and when all unit tests pass we will release a new package on NuGet and to download during the next hours. Best regards Tom.
Crawler-Lib Developer
Posted: 3 years ago Quote #84
Version 2.2.5490.21676 is released. It fixes the ClickOnce issues. Please update the NuGet package in your project.
Change the "Build Action" in the properties for "CrawlerLib.Engine.license" to Content. The license file will be automatically included and published.

Please add this line in the Main() method to prevent the application from accidentally using the anonymous edition:

if (CrawlerLib.Engine.LicenseInfo.LicenseType == CrawlerLib.Engine.LicenseInfo.LicenseTypeEnum.Anonymous) throw new InvalidOperationException("Anonymous License found, install correct license  ");
Crawler-Lib Developer
Posted: 3 years ago Quote #85
Awesome. That works for me. Thanks again for all your help and for the timely response.
Posted: 3 years ago Quote #86
I just wanted to give the users an FYI that if you have/are updating the Lib through NuGet to this latest version that you need to go back to your download page and download a new license for it to switch from anonymous to community again. Thanks again, Tom! Your library kicks butt….
Posted: 3 years ago Quote #87
Hi Peter, thank you for the information. The check I've posted above (with the thrown exception) should prevent anybody from using the anonymous edition in production. After all the trouble with the licensing I'm currently refactoring the licensing and dropping the product we are using at the moment.

Have you any suggestions ho we can improve the licensing and avoid those problems?

Best regards Tom.
Crawler-Lib Developer
Posted: 3 years ago Quote #88
I'm afraid I'm of no help in that department, Tom. I have never had to support licensing for applications/libraries before. I'm not sure what you are using now but my friend uses CopyMinder.
If I see him this week I'll get an opinion from him about it.
Posted: 3 years ago Quote #89
Thank you for your response. We will use our own licensing system (In fact signed XML data). My question was a little bit unclear. I mean how can the licensing process [purchase products (even free ones), generate licenses, having to deal with license files …] be improved. What was the most annoying part for you?
Crawler-Lib Developer