VS2008 Web 部署项目部分替换为 Elmah

发布于 2024-07-19 14:01:33 字数 553 浏览 5 评论 0原文

我正在使用一个 Web 部署项目,并且想要用 emlah/errorMail 部分进行一些部分替换。 我不想在调试构建模式下发送电子邮件。

我已经创建了自定义部分并将其放入 errorMail.config 中。 在替换下的 Web 部署项目的属性中,我有 elmah/errorMail=errorMail.config。

我收到的错误是为 elmah/errorMail 创建配置节处理程序时发生错误:无法加载文件或程序集“Elmah”或其依赖项之一。 该系统找不到指定的文件。

我猜测发生这种情况是因为 Elmah 不在 GAC 中,或者它不是我的项目之一。 不过,Elmah.dll 文件确实会复制到 output\bin 文件夹。

有没有办法让节替换与第 3 方 dll 一起工作?

[编辑]

我发现,如果我将有问题的 dll 放入 Web 部署项目的项目文件夹中,它将正常工作。 这不是最佳的。

所以现在我的问题是,如何才能使其正常工作,而不必将 dll 放入 GAC 中或不必将 dll 复制到 Web 部署项目文件夹中?

I'm using a web deployment project and want to do some section replacement with the emlah/errorMail section. I don't want to send emails in debug build mode.

I have created the custom section and put it in an errorMail.config. In the properties of web deploy project under replacements, I have elmah/errorMail=errorMail.config.

The error I'm getting is An error occurred creating the configuration section handler for elmah/errorMail: Could not load file or assembly 'Elmah' or one of its dependencies. The system cannot find the file specified.

I'm guessing this is happening because Elmah is not in the GAC or it's not one of my projects. The Elmah.dll file does copy to the output\bin folder just fine though.

Is there a way to have section replacements work with 3rd party dlls?

[EDIT]

I found that if I drop the dll in question into the project folder for the web deployment project, that it will work fine. This is less than optimal.

So now my question is, how can I get this to work without having to put the dll in the GAC or having to copy the dll into the web deployment project folder?

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

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

发布评论

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

评论(2

沫尐诺 2024-07-26 14:01:33

如果您从 web 项目中添加对 elmah dll 的引用,那么当您构建它时,它会自动将 dll 复制到输出文件夹。

不过,这是仅有的两个选项:将 dll 复制到输出目录或将其放入 GAC 中

If you add a reference to the elmah dll from your webproject, then it will automatically copy the dll to the output folder when you build it.

Those are the only 2 options though: to have the dll copied to the output directory or to put it in the GAC

维持三分热 2024-07-26 14:01:33

此处提出的技术在 Web 部署构建过程中动态加载程序集,以便它不会不必在 GAC 中。 我尝试过,但无法让它发挥作用。

A technique proposed here dynamically loads an assembly during the web deployment build process so that it doesn't have to be in the GAC. I tried, but was unable to get it to work, though.

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