ConfigurationErrorsExecption was unhandled.

H

hsphuah

Hi all,

I am new to the Microsoft .Net and hope that someone can help me on my
problem.

I have my C# program compiled but when I run it, one of the Microsoft
Enterprise Library - Jan 2006 throw an exception handle by
ConfigurationErrorsException. The error message is:

An error occurred creating the configuration section handler for
enterpriseLibrary.ConfigurationSource: Could not load file or assembly
'Microsoft.Practices.EnterpriseLibrary.Common, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=3be2f8f49e972371' or one of its
dependencies. The located assembly's manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040) (C:
\GEM\IMS Server\IMS.Server\bin\Debug
\IMSIndicatorManager.vshost.exe.config line 4)

The above exception is thrown from this function implementation:

public static Database CreateDatabase(string name)
{
try
{
DatabaseProviderFactory factory = new
DatabaseProviderFactory(ConfigurationSourceFactory.Create());
return factory.Create(name);
}
catch (ConfigurationErrorsException
configurationException)
{
TryLogConfigurationError(configurationException,
name);

throw;
}
}

Is there any suggestions to fix it?Thanks.

HS
 
W

WishMaster

Hi all,

I am new to the Microsoft .Net and hope that someone can help me on my
problem.

I have my C# program compiled but when I run it, one of the Microsoft
Enterprise Library - Jan 2006 throw an exception handle by
ConfigurationErrorsException. The error message is:

An error occurred creating the configuration section handler for
enterpriseLibrary.ConfigurationSource: Could not load file or assembly
'Microsoft.Practices.EnterpriseLibrary.Common, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=3be2f8f49e972371' or one of its
dependencies. The located assembly's manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040) (C:
\GEM\IMS Server\IMS.Server\bin\Debug
\IMSIndicatorManager.vshost.exe.config line 4)

The above exception is thrown from this function implementation:

public static Database CreateDatabase(string name)
{
try
{
DatabaseProviderFactory factory = new
DatabaseProviderFactory(ConfigurationSourceFactory.Create());
return factory.Create(name);
}
catch (ConfigurationErrorsException
configurationException)
{
TryLogConfigurationError(configurationException,
name);

throw;
}

}

Is there any suggestions to fix it?Thanks.

HS

Hi,

Not sure what .net framework you are using. EntLib Jan2006 works only
on Framework 2.0 with VS 2005.
If you already have then you need to put the required assemblies in
GAC or bin directory and then add the refrence to your project before
use them.

let me know if this is this not case.

Cheers,
Amer
 
H

hsphuah

Yes, I am using VS2005. I checked the .net framework v2.0, there is
not gacutil.exe likes v1.1 How to assemblies in GAC? I have added all
necessary files installed in my VS project.

Cheers.
HS
 
W

WishMaster

Yes, I am using VS2005. I checked the .net framework v2.0, there is
not gacutil.exe likes v1.1 How to assemblies in GAC? I have added all
necessary files installed in my VS project.

Cheers.
HS






- Show quoted text -

it is weird...
No, you don't have to put the assemblies in GAC.
If assemblies are in your project refrence it should be fine as well.
just make sure you have added the
"Microsoft.Practices.EnterpriseLibrary.Common.dll " in project
refrence.

If possible send me the list of files you have in your project
refrence.

I will check my setting tomorrow in office machine and let you know.

Cheers,
Amer
 
H

hsphuah

Thanks for your help. I do not think I can post my project to you due
to my company copyright issue.

I noticed that my laptop default .net framework is V1.1. How to change
it to V2.0? Fyi, run the "assembly" command, all dll does not have any
entlib v2.0 library registered.

HS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top