Could not load file or assembly 'Microsoft.Web.Infrastructure hatası

alattin (16999) 9 yıl önce sordu

Sunucuya yüklediğim Asp.Net MVC uygulaması  aşağdaki hatayı veriyor

Server Error in '/' Application.

Could not load file or assembly 'Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Source Error: 
 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.

Microsoft.Web.Infrastructure hatasının çözümü nedir?

Toplam 1 cevap


alattin (16999) 9 yıl önce cevapladı

Yukarıda belirttiğim gibi Microsoft.Web.Infrastructure.dll hatası alıyorsanız,  sunucuda GAC (Global Assembly Cache) içinde Microsoft.Web.Infrastructure.dll yok demektir.

Aynı zamanda sunucunuzda uygulamanızın Bin klasöründe Microsoft.Web.Infrastructure.dll dosyası yok demektir.

Sunucunuzda uygulama klasörünün altında bulunan Bin klasörüne Microsoft.Web.Infrastructure.dll dosyasını yükleyerek sorunu çözebilirsiniz.

Bu hatayı lokalde alıyorsanız Visual studio içinde Tools --> Library Package Manager --> Package Manager Console yolunu izleyin.Şu komutu uygulayın:

Install-Package Microsoft.Web.Infrastructure

Böylelikle uygulamanıza Microsoft.Web.Infrastructure.dll kütüphanesini dahil etmiş olacaksınız.