By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,435 Members | 2,033 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,435 IT Pros & Developers. It's quick & easy.

The format of the file 'Microsoft.Practices.EnterpriseLibrary.Data' is invalid

P: n/a
js
I got this error when I moved my application to a new Windows 2003
server. I installed and recompiled the
'Microsoft.Practices.EnterpriseLibrary - 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 EnterpriseLibrary 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.Practices.EnterpriseLibrary.Data, Version=1.0.0.0. Please
help. Thanks.

======================== My Web.Config (partial)
==========================
<configSections>
<section name="enterpriselibrary.configurationSettings"
type="Microsoft.Practices.EnterpriseLibrary.Config uration.ConfigurationManagerSectionHandler,
Microsoft.Practices.EnterpriseLibrary.Configuratio n,
Version=1.1.0.0,
Culture=neutral,
PublicKeyToken=60c24972b7c20af7" />
</configSections>

<enterpriselibrary.configurationSettings
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
applicationName="DMS_ASPX"
xmlns="http://www.microsoft.com/practices/enterpriselibrary/08-31-2004/configuration">
<configurationSections>
<configurationSection xsi:type="ReadOnlyConfigurationSectionData"
name="dataConfiguration" encrypt="false">
<storageProvider xsi:type="XmlFileStorageProviderData"
name="XML File Storage Provider" path="dataConfiguration.config" />
<dataTransformer xsi:type="XmlSerializerTransformerData"
name="Xml Serializer Transformer">
<includeTypes />
</dataTransformer>
</configurationSection>
</configurationSections>
<keyAlgorithmStorageProvider xsi:nil="true" />
<includeTypes />
</enterpriselibrary.configurationSettings>

========================= 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.BadImageFormatException: The format of the
file 'Microsoft.Practices.EnterpriseLibrary.Data' is invalid.

Source Error:
[No relevant source lines]
Source File: c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Tempo rary
ASP.NET Files\root\88f31b66\ffb9ac8b\x-56vhi4.0.cs Line: 0

Assembly Load Trace: The following information can be helpful to
determine why the assembly 'Microsoft.Practices.EnterpriseLibrary.Data'
could not be loaded.
=== Pre-bind state information ===
LOG: DisplayName = Microsoft.Practices.EnterpriseLibrary.Data,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=60c24972b7c20af7
(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\microsoft.net\framework\v1.1.4322\aspn et.config).
LOG: Using machine configuration file from
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\confi g\machine.config.
LOG: Post-policy reference: Microsoft.Practices.EnterpriseLibrary.Data,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=60c24972b7c20af7
LOG: Attempting download of new URL
file:///c:/windows/microsoft.net/framework/v1.1.4322/Temporary ASP.NET
Files/root/88f31b66/ffb9ac8b/Microsoft.Practices.EnterpriseLibrary.Data.DLL.
LOG: Attempting download of new URL
file:///c:/windows/microsoft.net/framework/v1.1.4322/Temporary ASP.NET
Files/root/88f31b66/ffb9ac8b/Microsoft.Practices.EnterpriseLibrary.Data/Microsoft.Practices.EnterpriseLibrary.Data.DLL.
LOG: Attempting download of new URL
file:///C:/Inetpub/DMS_Net/bin/Microsoft.Practices.EnterpriseLibrary.Data.DLL.

Stack Trace:
[BadImageFormatException: The format of the file
'Microsoft.Practices.EnterpriseLibrary.Data' is invalid.]
DMS_ASPX.Helper.DataBroker..ctor() +0
DMS_ASPX.form.main..ctor() +53
ASP.main_aspx..ctor() in
c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Tempo rary ASP.NET
Files\root\88f31b66\ffb9ac8b\x-56vhi4.0.cs:0

[TargetInvocationException: Exception has been thrown by the target of
an invocation.]
System.RuntimeType.CreateInstanceImpl(Boolean publicOnly) +0
System.Activator.CreateInstance(Type type, Boolean nonPublic) +66
System.Web.UI.TemplateControlParser.GetCompiledIns tance(String
virtualPath, String inputFile, HttpContext context) +164

[HttpException (0x80004005): Failed to create page of type
'ASP.main_aspx'.]
System.Web.UI.TemplateControlParser.GetCompiledIns tance(String
virtualPath, String inputFile, HttpContext context) +341
System.Web.UI.PageParser.GetCompiledPageInstanceIn ternal(String
virtualPath, String inputFile, HttpContext context) +43
System.Web.UI.PageHandlerFactory.GetHandler(HttpCo ntext context,
String requestType, String url, String path) +44
System.Web.HttpApplication.MapHttpHandler(HttpCont ext context,
String requestType, String path, String pathTranslated, Boolean
useAppConfig) +699

System.Web.MapHandlerExecutionStep.System.Web.Http Application+IExecutionStep.Execute()
+95
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously) +173


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2300;
ASP.NET Version:1.1.4322.2300

Mar 9 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
js
Ok. I solved this problem myself. It turns out that the Enterprise
Library Configuration utility created two .config files in the
application root:

web.config
dataconfiguration.config

I changed the reference version in both of the config file to the
correct version.

Mar 13 '06 #2

P: n/a
js
Ok. I solved this problem myself. It turns out that the Enterprise
Library Configuration utility created two .config files in the
application root:

web.config
dataconfiguration.config

I changed the reference version in both of the config file to the
correct version.

Mar 13 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.