Thursday, December 5, 2019

Sitecore Publishing Service 4.1.0 Setup Error With DotNet Core Library

Recently I was trying to set Sitecore Publishing Service 4.1.0 with Sitecore 9.1

While trying to setup the Publishing Service manually, and did the all the steps described in the documentation.
After those I was trying to start the IIS site and then tried to visit the site using following url to verify the solution.

http://sc910.publishing/api/publishing/operations/status

An error occurred while starting the application. .NET Framework 4.8 ...

So then I tried to start the publishing service as a service from Powershell using following command and it also returned following error message.

.\Sitecore.Framework.Publishing.Host --urls 'http://sc910.publishing:5000' -environment Development

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)


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

What I did was, I open the properties of that dll and click "Unlock" button in the popup window.

Then, Sitecore Publishing Service start to work as expected.



Happy Sitecore!

3 comments:

  1. I've seen this trip up quite a few people now. Another alternative to hunting the specific DLL would be to Unblock the Publishing Service zip file after download :thumbsup:

    ReplyDelete
  2. Thanks a lot! I was stuck on the issue for hours and then found your post.

    ReplyDelete
  3. Thanks man, this helped a lot!

    ReplyDelete