I got this error when I moved my application to a new Windows 2003
server. I installed and recompiled the
'Microsoft.Prac tices.Enterpris eLibrary - June 2005" then added these
assemblies to the development machine's Assembly Cache. The assemblies
version appears to be 1.1.0.0. I changed the project reference to the
newly compiled EnterpriseLibra ry DLLs. The Web.Config of my
application root, I also have the following <configSections >. I don't
know why at runtime it is still asking for
Microsoft.Pract ices.Enterprise Library.Data, Version=1.0.0.0 . Please
help. Thanks.
=============== ========= My Web.Config (partial)
=============== ===========
<configSections >
<section name="enterpris elibrary.config urationSettings "
type="Microsoft .Practices.Ente rpriseLibrary.C onfiguration.Co nfigurationMana gerSectionHandl er,
Microsoft.Pract ices.Enterprise Library.Configu ration,
Version=1.1.0.0 ,
Culture=neutral ,
PublicKeyToken= 60c24972b7c20af 7" />
</configSections>
<enterpriselibr ary.configurati onSettings
xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
applicationName ="DMS_ASPX"
xmlns="http://www.microsoft.c om/practices/enterpriselibra ry/08-31-2004/configuration">
<configurationS ections>
<configurationS ection xsi:type="ReadO nlyConfiguratio nSectionData"
name="dataConfi guration" encrypt="false" >
<storageProvide r xsi:type="XmlFi leStorageProvid erData"
name="XML File Storage Provider" path="dataConfi guration.config " />
<dataTransforme r xsi:type="XmlSe rializerTransfo rmerData"
name="Xml Serializer Transformer">
<includeTypes />
</dataTransformer >
</configurationSe ction>
</configurationSe ctions>
<keyAlgorithmSt orageProvider xsi:nil="true" />
<includeTypes />
</enterpriselibra ry.configuratio nSettings>
=============== ========== Runtime Error =============== ==========
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.BadImage FormatException : The format of the
file 'Microsoft.Prac tices.Enterpris eLibrary.Data' is invalid.
Source Error:
[No relevant source lines]
Source File: c:\WINDOWS\Micr osoft.NET\Frame work\v1.1.4322\ Temporary
ASP.NET Files\root\88f3 1b66\ffb9ac8b\x-56vhi4.0.cs Line: 0
Assembly Load Trace: The following information can be helpful to
determine why the assembly 'Microsoft.Prac tices.Enterpris eLibrary.Data'
could not be loaded.
=== Pre-bind state information ===
LOG: DisplayName = Microsoft.Pract ices.Enterprise Library.Data,
Version=1.0.0.0 , Culture=neutral , PublicKeyToken= 60c24972b7c20af 7
(Fully-specified)
LOG: Appbase = file:///C:/Inetpub/DMS_Net
LOG: Initial PrivatePath = bin
Calling assembly : DMS_ASPX, Version=0.0.0.0 , Culture=neutral ,
PublicKeyToken= null.
===
LOG: Publisher policy file is not found.
LOG: No redirect found in host configuration file
(c:\windows\mic rosoft.net\fram ework\v1.1.4322 \aspnet.config) .
LOG: Using machine configuration file from
C:\WINDOWS\Micr osoft.NET\Frame work\v1.1.4322\ config\machine. config.
LOG: Post-policy reference: Microsoft.Pract ices.Enterprise Library.Data,
Version=1.0.0.0 , Culture=neutral , PublicKeyToken= 60c24972b7c20af 7
LOG: Attempting download of new URL
file:///c:/windows/microsoft.net/framework/v1.1.4322/Temporary ASP.NET
Files/root/88f31b66/ffb9ac8b/Microsoft.Pract ices.Enterprise Library.Data.DL L.
LOG: Attempting download of new URL
file:///c:/windows/microsoft.net/framework/v1.1.4322/Temporary ASP.NET
Files/root/88f31b66/ffb9ac8b/Microsoft.Pract ices.Enterprise Library.Data/Microsoft.Pract ices.Enterprise Library.Data.DL L.
LOG: Attempting download of new URL
file:///C:/Inetpub/DMS_Net/bin/Microsoft.Pract ices.Enterprise Library.Data.DL L.
Stack Trace:
[BadImageFormatE xception: The format of the file
'Microsoft.Prac tices.Enterpris eLibrary.Data' is invalid.]
DMS_ASPX.Helper .DataBroker..ct or() +0
DMS_ASPX.form.m ain..ctor() +53
ASP.main_aspx.. ctor() in
c:\WINDOWS\Micr osoft.NET\Frame work\v1.1.4322\ Temporary ASP.NET
Files\root\88f3 1b66\ffb9ac8b\x-56vhi4.0.cs:0
[TargetInvocatio nException: Exception has been thrown by the target of
an invocation.]
System.RuntimeT ype.CreateInsta nceImpl(Boolean publicOnly) +0
System.Activato r.CreateInstanc e(Type type, Boolean nonPublic) +66
System.Web.UI.T emplateControlP arser.GetCompil edInstance(Stri ng
virtualPath, String inputFile, HttpContext context) +164
[HttpException (0x80004005): Failed to create page of type
'ASP.main_aspx' .]
System.Web.UI.T emplateControlP arser.GetCompil edInstance(Stri ng
virtualPath, String inputFile, HttpContext context) +341
System.Web.UI.P ageParser.GetCo mpiledPageInsta nceInternal(Str ing
virtualPath, String inputFile, HttpContext context) +43
System.Web.UI.P ageHandlerFacto ry.GetHandler(H ttpContext context,
String requestType, String url, String path) +44
System.Web.Http Application.Map HttpHandler(Htt pContext context,
String requestType, String path, String pathTranslated, Boolean
useAppConfig) +699
System.Web.MapH andlerExecution Step.System.Web .HttpApplicatio n+IExecutionSte p.Execute()
+95
System.Web.Http Application.Exe cuteStep(IExecu tionStep step, Boolean&
completedSynchr onously) +173
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.432 2.2300;
ASP.NET Version:1.1.432 2.2300