Log4net.dll file not found

Asked

Viewed 1,487 times

0

All these dlls are in the bin folder and have been referenced in the project, the project is compiled without errors:

<compilation debug="true" targetFramework="4.0">
  <assemblies>
    <add assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
    <add assembly="CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
    <add assembly="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
    <add assembly="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
    <add assembly="CrystalDecisions.ReportAppServer.Controllers, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
    <add assembly="CrystalDecisions.ReportAppServer.DataDefModel, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
    <add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
    <add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
    <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="DevExpress.Web.ASPxGridView.v12.1, Version=12.1.7.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A"/>
    <add assembly="DevExpress.Web.ASPxEditors.v12.1, Version=12.1.7.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A"/>
    <add assembly="DevExpress.Web.v12.1, Version=12.1.7.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A"/>
    <add assembly="DevExpress.Data.v12.1, Version=12.1.7.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A"/>
    <add assembly="DevExpress.Web.ASPxGridView.v12.1.Export, Version=12.1.7.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A"/>
    <add assembly="DevExpress.XtraPrinting.v12.1, Version=12.1.7.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A"/>
    <add assembly="DevExpress.Printing.v12.1.Core, Version=12.1.7.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A"/>
    <add assembly="DevExpress.XtraEditors.v12.1, Version=12.1.7.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A"/>
  </assemblies>
</compilation>

However when running the system (F5) the following error is displayed (line 58):

Erro de configuração

Descrição: Erro durante o processamento de um arquivo de configuração necessário para o serviço desta solicitação. Examine os detalhes específicos do erro e modifique esse arquivo de configuração apropriadamente. 

Mensagem de Erro do Analisador: Não foi possível carregar arquivo ou assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' ou uma de suas dependências. A definição do manifesto do assembly localizado não corresponde à referência do assembly. (Exceção de HRESULT: 0x80131040)

Erro de Origem: 


Linha 56:         <add assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
Linha 57:         <add assembly="CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
**Linha 58:         <add assembly="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>**
    Linha 59:         <add assembly="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
    Linha 60:         <add assembly="CrystalDecisions.ReportAppServer.Controllers, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
  • I don’t know much about it, but the message doesn’t say it’s missing log4net.dll, it is quite likely that you are using the different version or something.

  • Also I do not understand very well, however the version of the file log4net.dll that is in bin folder is the msm version of line 58 as in the example in the question: version Version=1.2.10.0

2 answers

2

I know the question has been answered for a while, but one solution that served me was to use the Nuget package manager for installation.

I needed version 1.2.15 on mine, so I installed it on the VS console.

Use the command below for version 1.2.15:

Install-Package log4net-1.2.15 -Version 1.2.15

Follow the link for more information: https://www.nuget.org/packages/log4net-1.2.15/1.2.15

1


I believe you have already found the solution, but to register a possible solution.

In many personal cases this occurred by version incompatibility.

For Visual Studio 2015:

Right click on the Solution and go to "Manage Nuget Packages for Solution.."

On the tab "Installed" click on the package with error and check that in all projects the version is the same.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.