ASP.NET DLL 地狱

发布于 2024-07-10 12:02:51 字数 1103 浏览 8 评论 0原文

我有第三方工作流程软件 (Captaris Teamplate),它引用我的项目中的一个程序集,该程序集通过 GAC

当我们的应用程序执行时,它会调用 Captaris Teamplate 方法来创建工作流过程,该工作流过程又使用 GAC 中的项目程序集将数据存储到 一个数据库。

问题是,当我编译项目并从 GAC 中删除程序集并将其替换为新版本时,但是当我运行整个项目时,Captaris Teamplate 会抛出错误:

异常类型:System.IO.FileNotFoundException
消息:找不到文件或程序集名称 VBAssembly 或其依赖项之一。
文件名:VBAssembly
FusionLog:===预绑定状态信息===
日志:DisplayName = VBAssembly,版本=0.0.0.0,文化=中性,PublicKeyToken=null

也就是说,它不会给我程序集 DLL 文件的名称。 它试图找到它正在寻找的版本。 解决此类问题就像在黑暗中射击一样,它可能会花费数天的时间来删除保留在 ASP.NET 临时文件夹、项目文件夹和网站文件夹 (inetpub) 中的旧程序集、重新启动等、测试错误,出现错误,搜索一些其他旧程序集等。

所以我的问题是:

  1. 是否有一种技术可以让我提取有关此异常的更多信息,例如缺少程序集的名称和版本?
  2. 有没有一种简单的方法可以在编译时清除系统中所有旧的程序集版本?
  3. 对于处理这个 DLL Hell 和/或 Captaris Teamplate,还有其他建议吗?

我们将 ASP.NET 1.1 版与 Visual Studio 2003 和 Captaris Workflow 5.0 结合使用。

I have third-party workflow software (Captaris Teamplate) that's referencing an assembly from my project that's referencing other assemblies from our project solution all through the GAC.

When our application executes, it invokes a Captaris Teamplate method to create a workflow process which in turn uses project assemblies in the GAC to store data into
a database.

The problem is when I compile my project and remove assemblies from GAC replacing them with new versions, but when I run entire project, Captaris Teamplate throws an error:

Exception Type: System.IO.FileNotFoundException
Message: File or assembly name VBAssembly, or one of its dependencies, was not found.
FileName: VBAssembly
FusionLog: === Pre-bind state information ===
LOG: DisplayName = VBAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null

That is, it wouldn't give me the name of the assembly DLL file. It's trying to find nor version it's looking for. Troubleshooting of such an issue is like shooting in the dark and it can kill days of deleting old assemblies that are kept in the ASP.NET temporary files folder, project folder and website folder (inetpub), rebooting, etc., testing for error, getting an error, searching for some other old assemblies, etc.

So my questions are:

  1. Is there a technique that would allow me to extract more information on this exception such as the name of the assembly and version that is missing?
  2. Is there an easy way to clean up all those old assembly versions from the system at compile time?
  3. Any other suggestions in dealing with this DLL Hell and/or Captaris Teamplate?

We're using ASP.NET version 1.1 with Visual Studio 2003 with Captaris Workflow 5.0.

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

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

发布评论

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

评论(7

转角预定愛 2024-07-17 12:02:51

您可以做的另一件事是通过 web.config“强制”引用您想要的程序集的版本。 这是我的 web.config 中的示例,以确保我在网络应用程序中访问正确版本的 Crystal Reports...

<assemblies>       
   <add assembly="CrystalDecisions.Web, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
   <add assembly="CrystalDecisions.Shared, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
   <add assembly="CrystalDecisions.ReportSource, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
   <add assembly="CrystalDecisions.Enterprise.Framework, Version=11.5.3300.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>            
</assemblies>

我确信您可以执行相同的操作来引用您的库,您只需要确保它们有一个强大的命名密钥,以便有一个 PublicKeyToken 可供引用。

Another thing you can do is "forcibly" reference the version of the assembly you want through the web.config. Here's a sample of what I have in my web.config to make sure I'm accessing the proper version of Crystal Reports in my web app...

<assemblies>       
   <add assembly="CrystalDecisions.Web, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
   <add assembly="CrystalDecisions.Shared, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
   <add assembly="CrystalDecisions.ReportSource, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
   <add assembly="CrystalDecisions.Enterprise.Framework, Version=11.5.3300.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>            
</assemblies>

I'm sure you could do the same thing to reference your libraryies, you just need to make sure they have a strong naming key so that there is a PublicKeyToken to reference.

你穿错了嫁妆 2024-07-17 12:02:51

如果可能的话,请避开 GAC。 它适合 DLL 地狱。 VBAssembly 实际上可能是非托管的,并且可能已从 WINDOWS/system32 目录中删除。

If at all possible, avoid the GAC. It lends itself to DLL Hell. The VBAssembly may actually be unmanaged, and may have been removed from the WINDOWS/system32 directory.

祁梦 2024-07-17 12:02:51

也许您可以创建一个绑定策略,将您从 XXX 删除的程序集的任何请求重定向到 GAC 到新位置。 请参阅绑定策略 >。

Maybe you can create a binding policy that will redirect any request for the assembly you removed from the XXX to the GAC to the new location. See Binding Policy.

绝不放开 2024-07-17 12:02:51

或者您可以使用 .NET Reflector

但是,您也可能只想致电供应商并向他们寻求帮助。 大多数时候,这些人对他们的产品非常自豪,因此他们会花时间通过电子邮件或聊天来引导您解决问题。 我刚刚遇到了我正在使用的第三方电子表格组件的类似问题,即使该公司位于德国,我也能够通过让他们重新编译该组件并在他们发送给我时很快解决该问题新的 DLL 运行得很好。

Or you can use .NET Reflector.

However, you also may just want to call up the vendor and ask for help from them. Most of the time, these guys take a pretty good pride in their products so they will take the time to step you through your problem over email or chat. I just ran into a similar issue with a third-party spreadsheet component that I was using and even though the company was in Germany, I was able to resolve the issue pretty quickly by having them recompile the component on their end and when they sent me the new DLL it worked just fine.

微凉徒眸意 2024-07-17 12:02:51

最有效的方法可能是运行 FusLogVW.exe(.NET Framework SDK 的一部分,请参阅程序集绑定日志查看器 (Fuslogvw.exe)),它将记录发生的每个绑定失败。 这样,您可以列出应用程序中失败的绑定尝试。

Probably the most effective way is to run FusLogVW.exe (part of .NET Framework SDK, see Assembly Binding Log Viewer (Fuslogvw.exe)), which will log every bind failure that happens. That way, you can list failed binding attempts from your application.

独夜无伴 2024-07-17 12:02:51

使用 Dependency Walker 找出缺少的依赖项。

Use Dependency Walker to find out what dependency is missing.

水中月 2024-07-17 12:02:51

起点是尝试使用“清洁解决方案”选项,然后构建解决方案。

A starting point is to try to use the 'Clean Solution' option and then build the solution.

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