Sunday 22 May 2022

Sitecore Publishing Service 4.3.0 Setup Error With DotNet Core Library

Recently I was trying to set Sitecore Publishing Service 4.3.0 with Sitecore 9.3.

While trying to set up the Publishing Service manually, and did all the steps described in the documentation. After those, I tried to visit the site using the following URL to verify the solution.

http://sitecorepublishing/api/publishing/operations/status



Application startup exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileLoadException: Could not load file or assembly 'Serilog.AspNetCore, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515) ---> System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.

   --- End of inner exception stack trace ---

   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)

   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)

   at System.Reflection.Assembly.Load(AssemblyName assemblyRef)

   at Serilog.Settings.Configuration.ConfigurationReader.LoadConfigurationAssemblies()

   at Serilog.Settings.Configuration.ConfigurationReader..ctor(IConfigurationSection configuration, DependencyContext dependencyContext)

   --- End of inner exception stack trace ---

   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)

   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)

   at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)

   at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)

   at Sitecore.Framework.Publishing.Host.SerilogExtensions.SerilogConfigurationSection(LoggerSettingsConfiguration settingConfiguration, IConfigurationSection configuration, DependencyContext dependencyContext)

   at Sitecore.Framework.Publishing.Host.Startup.ConfigureLogging(ILoggingBuilder loggingBuilder)

   at Microsoft.Extensions.DependencyInjection.LoggingServiceCollectionExtensions.AddLogging(IServiceCollection services, Action`1 configure)

   at Sitecore.Framework.Publishing.Host.Startup.ConfigureServices(IServiceCollection services)

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)

   at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()

   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()

Press Ctrl+C to shut down.


The error was complaining about "Serilog.AspNetCore.dll" which comes with the Publishing service installation.

Solution: I open the properties of  "Serilog.AspNetCore.dll"  and click the "Unlock" button in the popup window.


Then, Sitecore Publishing Service start to work as expected.



How to install Sitecore Publishing Service - Quick Guide.









No comments:

Post a Comment

Sitecore Publishing Service 7.0 Installation Guide

  About the Publishing Service module The Publishing Service module is an optional replacement for the existing Sitecore publishing methods....