使用Data Access Application Block遇到的问题
2005-06-16 15:49
609 查看
1、这是个来自 http://blog.hishambaz.com/archive/2005/01/29/194.aspx 的问题,这个问题是出在选择解决问题的方式上。大家有人遇到过吗,是Bug吗?
When trying the data access application on my own project does not find the configurationData somehow it goes and read the Machine.config from the .net framework dir in winnt. I have the dataConfiguration.config in my debug dir.
Additional information:
Invalid section name. The section 'dataConfiguration' does not exist in the requested configuration file 'C:\workdir\dbproj\dbWinApp3\bin\Debug\dbWinApp3.exe.config' or the file 'c:\winnt\microsoft.net\framework\v1.1.4322\Config\machine.config'. Make sure that the 'enterpriseLibrary.configurationSections' configuration section exists in one of the files and that the section 'dataConfiguration' is defined.
The solution that worked for me is as follow:
I copied dataConfiguration.config and App.config to my debug dir and renamed App.config as my executable dbWinApp3.exe.config and compiled my App afterward. To my suprise after compilation dbWinApp3.exe.config was getting deleted so I was getting the Invalid section name and not findig the enterpriseLibrary.configurationSections. So I change my dbWinApp3.exe.config file in my debug dir to readonly by right clicking on the file and selecing the readonly option. So it no longer got deleted after the compilation and it worked. There is a workaround this problem with doing a postbuildcommand in VStudio that after compilation copy the files to debug dir not before like the way I am doing. I have to look it up to see how it is done. I hope it works for you.
2、我尽量描述清我遇到的问题:
解决方案里有两个项目,DAL和UI。UI作为启动项目,DAL中有个使用DAAB调用存储过程的SalesData的类。UI中有两个自定义控件和一个启动窗体TestForm。A控件使用了SalesData的实例,B控件与EntLib无关。我使用“启动新实例”调试UI项目(之前并没有生成解决方案),A、B控件就出现在ToolBox里了,我将B拖入TestForm正常,但将A拖入则弹出错误,给出的信息类似上面那位老兄所遇到的,但是我这里是devnev.config和machine.config中没有声明‘dataConfiguration'!声明一点:我使用了POSTBUILD COMMAND, 而且使用B工作正常!(生成解决方案也是一样)
3、我认为在devenv.exe.config和machine.config中找’dataConfiguration.config',与在**.exe.config和machine.config中找配置信息是不同的问题。我会进一步搜索、研究的。
I appreciate any help!
P.S. 参看这位老兄遇到的问题:
I'm getting an Invalid section name. error at design time when I try to open a control from another project that uses the caching block. Project A -ClassLibrary- has a control which uses caching block Project B-WebApp uses the control but when placed on the form shows ERROR CREATING CONTROL. Invalid Section Name.
When trying the data access application on my own project does not find the configurationData somehow it goes and read the Machine.config from the .net framework dir in winnt. I have the dataConfiguration.config in my debug dir.
Additional information:
Invalid section name. The section 'dataConfiguration' does not exist in the requested configuration file 'C:\workdir\dbproj\dbWinApp3\bin\Debug\dbWinApp3.exe.config' or the file 'c:\winnt\microsoft.net\framework\v1.1.4322\Config\machine.config'. Make sure that the 'enterpriseLibrary.configurationSections' configuration section exists in one of the files and that the section 'dataConfiguration' is defined.
The solution that worked for me is as follow:
I copied dataConfiguration.config and App.config to my debug dir and renamed App.config as my executable dbWinApp3.exe.config and compiled my App afterward. To my suprise after compilation dbWinApp3.exe.config was getting deleted so I was getting the Invalid section name and not findig the enterpriseLibrary.configurationSections. So I change my dbWinApp3.exe.config file in my debug dir to readonly by right clicking on the file and selecing the readonly option. So it no longer got deleted after the compilation and it worked. There is a workaround this problem with doing a postbuildcommand in VStudio that after compilation copy the files to debug dir not before like the way I am doing. I have to look it up to see how it is done. I hope it works for you.
2、我尽量描述清我遇到的问题:
解决方案里有两个项目,DAL和UI。UI作为启动项目,DAL中有个使用DAAB调用存储过程的SalesData的类。UI中有两个自定义控件和一个启动窗体TestForm。A控件使用了SalesData的实例,B控件与EntLib无关。我使用“启动新实例”调试UI项目(之前并没有生成解决方案),A、B控件就出现在ToolBox里了,我将B拖入TestForm正常,但将A拖入则弹出错误,给出的信息类似上面那位老兄所遇到的,但是我这里是devnev.config和machine.config中没有声明‘dataConfiguration'!声明一点:我使用了POSTBUILD COMMAND, 而且使用B工作正常!(生成解决方案也是一样)
3、我认为在devenv.exe.config和machine.config中找’dataConfiguration.config',与在**.exe.config和machine.config中找配置信息是不同的问题。我会进一步搜索、研究的。
I appreciate any help!
P.S. 参看这位老兄遇到的问题:
I'm getting an Invalid section name. error at design time when I try to open a control from another project that uses the caching block. Project A -ClassLibrary- has a control which uses caching block Project B-WebApp uses the control but when placed on the form shows ERROR CREATING CONTROL. Invalid Section Name.
相关文章推荐
- 微软发布的Data Access Application Block的使用代码
- Enterprise Library May 2007 Data Access Application Block的使用
- 微软发布的Data Access Application Block的使用代码
- 使用Data Access Application Block 得到存储过程的返回值
- Enterprise Library 4.0 Data Access Application Block 配置使用介绍
- Enterprise Library: Data Access Application Block使用向导,Part 1
- Enterprise Library: Data Access Application Block使用向导,Part 2
- updater application block v2.0的使用过程中遇到的问题及解决办法
- 三层结构B/S项目中使用Enterprise Library---Data Access Application Block
- Data Access Application Block 使用指南
- Enterprise Library: Data Access Application Block使用向导,Part 2
- 使用Data Access Application Block(数据访问应用程序块)
- Data Access Application Block(Enterprise Library 3.1)的下载以及使用方法介绍
- Data Access Application Block 中事务的使用
- 使用DataAccessApplicationBlock得到存储过程的返回值
- 折腾了我近2个小时的问题居然是由于MS Data Access Application Block Version 2.0中的Bug造成的
- Enterprise Library: Data Access Application Block使用向导,Part 2
- Data Access Application Block QuickStart 的详细使用过程
- Enterprise Library: Data Access Application Block使用向导,Part 1
- 如何在TableAdapter中使用Data Access Application Block的疑问??