简体   繁体   中英

Microsoft.Practices.EnterpriseLibrary.Common is not working in IIS 8.5 but its working in IIS 7.0

I have deployed my web application using by Microsoft.Practices.EnterpriseLibrary.Common dll and hosted in IIS 7.0 and its working fine (Able to access the DB) but same published code i am deploying in IIS 8.5 but its not working and i am getting bellow error.

ERROR System.TypeInitializationException: The type initializer for 'Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Practices.ObjectBuilder2, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory..cctor() --- End of inner exception stack trace --- at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory.BuildUp[T](IConfigurationSource configurationSource) at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseFactory.CreateDatabase()

This is an old question - but posting here for anyone looking for an answer.

Recently ran into this issue but with a Windows Service (of a legacy code/service). All we were trying to do was switch the Database server in the connection string from Server A to Server B.

Found the root cause to be that the SQL Authentication user id was not setup in Server B - seems obvious except that the error message wasn't. Anyways fixing the authentication issue addressed this exception for us.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM