更改时遇到问题 WDP 中 web.config 的部分

发布于 2024-07-23 09:09:36 字数 1328 浏览 2 评论 0原文

我有一个 web.config 文件,其中包含这样的部分:

<configuration>
  <configSections>
    <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
  </configSections>
  <dataConfiguration defaultDatabase="dev"/>

在我的 Web 部署项目中,我有一个使用以下行替换 dataConfiguration 部分的构建:

dataConfiguration=webStaging.dataConfiguration.config;

文件本身如下所示:

<?xml version="1.0"?>
<dataConfiguration defaultDatabase="staging"></dataConfiguration>

由于某种原因,当我尝试构建时它,我收到此错误:

错误 49 创建时发生错误 配置节处理程序 数据配置:无法加载文件 或组装 'Microsoft.Practices.EnterpriseLibrary.Data, 版本=3.1.0.0,文化=中立, PublicKeyToken=b03f5f7f11d50a3a' 或 它的依赖项之一。 系统 找不到指定的文件。 (\server\websites\scancenter\web.config 第 22 行) C:\Program 文件\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets 614 9 ScanCenter_deploy

不寻常的部分是,我可以毫无问题地替换 web.config 的其他部分,并且只有当我包含此替换时,我才可以使用它。得到一个错误。 有任何想法吗?

更新:

我认为这可能是相关的。 我们对企业库的引用来自 UNC 路径,因此我们有指向它们的刷新文件。

I have a web.config file that contains a section like this:

<configuration>
  <configSections>
    <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
  </configSections>
  <dataConfiguration defaultDatabase="dev"/>

And in my web deployment projects, I have a build that replaces the dataConfiguration section, using this line:

dataConfiguration=webStaging.dataConfiguration.config;

The file itself looks like this:

<?xml version="1.0"?>
<dataConfiguration defaultDatabase="staging"></dataConfiguration>

For some reason when I try to build it, I get this error:

Error 49 An error occurred creating
the configuration section handler for
dataConfiguration: Could not load file
or assembly
'Microsoft.Practices.EnterpriseLibrary.Data,
Version=3.1.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a' or
one of its dependencies. The system
cannot find the file specified.
(\server\websites\scancenter\web.config
line 22) C:\Program
Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets 614 9 ScanCenter_deploy

The unusual part about this is that I can replace other sections of web.config without any problem, and it's only when I include this replacement that I get an error. Any ideas?

Update:

I think this might be related. Our references to the enterprise library come from a UNC path, so we have refresh files that point to them.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

提笔落墨 2024-07-30 09:09:36

我确信你错过了一些东西。 由于您使用的是企业库,我建议您使用它提供的工具来构建您的配置文件。

我。 使用带有企业库的工具来构建您的配置文件。

二. 我确信它会起作用。 现在返回到您的代码并尝试找出错误。

I am sure you are missing something. Since you are using Enterprise library, I suggest you make use of the tool provided with it to build your config file.

i. Use the tool with enterprise library to construct your config file.

ii. I am sure it will work. Now go back to your code and try to identify the mistake.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文