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

ConfigurationErrorsExecption was unhandled.

P: n/a
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

Jan 31 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On Jan 31, 11:38 am, hsph...@usa.com wrote:
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

Jan 31 '07 #2

P: n/a
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

On Jan 31, 10:29 am, "WishMaster" <amer.chaud...@gmail.comwrote:
On Jan 31, 11:38 am, hsph...@usa.com wrote:


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 anexceptionhandle 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. (Exceptionfrom HRESULT: 0x80131040) (C:
\GEM\IMS Server\IMS.Server\bin\Debug
\IMSIndicatorManager.vshost.exe.config line 4)
The aboveexceptionis 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- Hide quoted text -

- Show quoted text -

Jan 31 '07 #3

P: n/a
On Jan 31, 8:16 pm, hsph...@usa.com wrote:
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

On Jan 31, 10:29 am, "WishMaster" <amer.chaud...@gmail.comwrote:
On Jan 31, 11:38 am, hsph...@usa.com wrote:
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 anexceptionhandle 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. (Exceptionfrom HRESULT: 0x80131040) (C:
\GEM\IMS Server\IMS.Server\bin\Debug
\IMSIndicatorManager.vshost.exe.config line 4)
The aboveexceptionis 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- Hide quoted text -
- Show quoted text -- Hide quoted text -

- 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

Jan 31 '07 #4

P: n/a
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

On Jan 31, 7:35 pm, "WishMaster" <amer.chaud...@gmail.comwrote:
On Jan 31, 8:16 pm, hsph...@usa.com wrote:


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
On Jan 31, 10:29 am, "WishMaster" <amer.chaud...@gmail.comwrote:
On Jan 31, 11:38 am, hsph...@usa.com wrote:
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 anexceptionhandle 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. (Exceptionfrom HRESULT: 0x80131040) (C:
\GEM\IMS Server\IMS.Server\bin\Debug
\IMSIndicatorManager.vshost.exe.config line 4)
The aboveexceptionis 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- Hide quoted text -
- Show quoted text -- Hide quoted text -
- 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- Hide quoted text -

- Show quoted text -

Feb 6 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.