请程序集达人帮忙解决这个棘手的问题
不多罗嗦了 直接见问题描述:
我的程序一共有10个模块左右 结构大概如下
一个主运行模块 AppProject
几个系统共通模块 ClassLibProject
还有一些独立调用模块 ClassLibProject
现在的问题是这样的 发布目录结构如下 主运行模块和系统共通模块放在 应用程序目录下 所有的独立模块放在 应用程序下的一个Modules文件夹下
现在问题是 主程序模块调用独立模块 引用采用程序集加载模式 Assembly.LoadFile()
独立调用的模块可能有逻辑互用 采用直接引用Reference
但是问题出现了 发布应用程序是把所有独立模块放到Modules下 其余在应用程序路径 其他的程序集引用没问题 但是独立调用的模块的Reference引用则出现问题 因为总是在应用程序路径APP根目录寻找程序集 所以总是提示 "找不到文件错误"
用Fuslogvw工具查看错误程序集绑定Log如下
=== Pre-bind state information ===
LOG: User = AAA
LOG: DisplayName = Coil.FaHuoModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///D:/Coil_SZ/SourceCode/Coil_Sln/Coil.Main/bin/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: D:\Coil_SZ\SourceCode\Coil_Sln\Coil.Main\bin\Debug\Coil.Main.vshost.exe.config
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: The same bind was seen before, and was failed with hr = 0x80070002.
(上网看了些资料 说是用probing 设置应用程序配置文件配置私有路径可以解决 但是在我的程序无效)
求达人多多指教,或者提供些别的思路...