0

My aim is to Configure Serilog logging. After installing following nuget packages i'm getting an error.

The error is attached below enter image description here

I get this error after installing Serilog.Sinks.AzureDocumentDB.

enter image description here

Arshath Shameer
  • 453
  • 4
  • 15
  • Could be many things apparently, did you see this? https://stackoverflow.com/questions/12226676/the-module-was-expected-to-contain-an-assembly-manifest – Crowcoder Jan 09 '18 at 11:34
  • @Crowcoder Yes I have already tried those and nothing is working for me. And I get this error after installing Serilog.Sinks.AzureDocumentDB. – Arshath Shameer Jan 11 '18 at 04:16
  • Could give some demo code to reproduce this? I test it with .net framework 4.7, but I can't reproduce this issue after install [Serilog.Sinks.AzureDocumentDB 3.8](https://www.nuget.org/packages/serilog.sinks.azuredocumentdb). If there is more information how to reproduce this is much bettter. – Tom Sun - MSFT Jan 12 '18 at 06:16
  • @TomSun My POC is working as expected but when it comes to my real API project it is not working and giving above error page. Find my POC in this url : https://github.com/serilog/serilog-sinks-azuredocumentdb/files/1625153/consoleappforserilog.zip – Arshath Shameer Jan 12 '18 at 06:58
  • I also test it in the WebApi project, it works correctly. I can write logs into azure documentdb. I will look into it, if any update, I will comment here. – Tom Sun - MSFT Jan 12 '18 at 07:04
  • It works as expected in the console or webapi project on my side. If the **Copy local** properties of Serilog.Sinks.AzureDocumentDB is **false**, please have a try to change it to true. And clean the project build and rebuild it again. – Tom Sun - MSFT Jan 12 '18 at 07:25
  • @TomSun Copy local value is true and cleaning up the project is also not solving this issue. build and rebuild also not resolving this issue. I even tried with deleting bin and obj folders as well. – Arshath Shameer Jan 12 '18 at 08:41
  • FYI : Exception Details : System.BadImageFormatException: Could not load file or assembly 'file:///C:\VSO\API\XXXX.API.REST\bin\DocumentDB.Spatial.Sql.dll' or one of its dependencies. The module was expected to contain an assembly manifest. – Arshath Shameer Jan 12 '18 at 08:43
  • @TomSun I have fixed the problem. I reinstalled all the nuget packages and consolidated to the same version.(All existing nuget in my project) – Arshath Shameer Jan 17 '18 at 11:08

1 Answers1

0

I have fixed the problem. I reinstalled all the nuget packages and consolidated to the same version. (All existing nuget in my project)

Arshath Shameer
  • 453
  • 4
  • 15