开发者

System.Configuration.ConfigurationErrorsException: in 64-bit windows server 2003

This is my configuration file looks like:

add name="ConnectionStringMP" connectionString="Database=MP;Server=ABC\MP;User ID=MP; password=MP1" providerName="System.Data.SqlClient"

And this is what i'm getting while calling method DatabaseFactory.CreateDatabase("ConnectionStringMP")

The requested database ConnectionStringMP is not defined in configuration. at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory.BuildUp[T](IReadWriteLocator locator, ILifetimeContainer lifetimeContainer, String id, IConfigurationSource configurationSource) at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory.BuildUp[T](String id, IConfigurationSource configurationSource) at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.NameTypeFactoryBase`1.Create(String name) at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseFactory.CreateDatabase(String name)

The above code is working perfectly fine on 32-bit windows 开发者_运维问答but having trouble only at 64-bit windows!

Any help would be appreciated. Thanks!


Is the connection string stored in machine.config? If so, machine.config is stored in C:\Windows\Microsoft.NET\Framework64\v2.0.50727\CONFIG for 64 bit applications (note the 64 in the path)


under win 64 some folders are routed, folders like 'program files' that get mapped to program files(x86) for 32bit apps. maybe your app is located in one of those routed folders ? (windows\system32 is also routed to windows\sysnative, little more on this here)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜