【发布时间】:2018-07-24 05:18:11
【问题描述】:
我正在尝试将我的 .NET Instrumentation 分析器部署到 Azure Web 应用程序中。使用 COR_PROFILER_32 和 *_64 和 COR_PROFILING_ENABLED 我正在 Azure Web 应用程序中启用我的探查器。
我的分析器会将代码检测到所有模块中,包括 .NET Framework 模块。 (例如 System.dll , System.Core.dll .. 等),甚至在用户模块中也是如此。检测代码将调用在单独的程序集“CAssemblyHelper.dll”中定义的函数,该程序集是“任何 CPU”构建的。
这里的问题是,当我的检测代码被调用时,会出现“FileNotFoundException”并出现错误消息。
涂黑的是我所指的程序集名称 CAssemblyHelper.dll。该程序集没有任何依赖关系。我已经探测了 dll 在 web 配置文件中的位置。
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="bin;PrivateFolder"/>
</assemblyBinding>
</runtime>
如何解决这个错误..!我在 IMetaDataAssemblyEmit 中使用 DefineAssemblyRef 来定义模块中的程序集。在普通的 IIS 服务器机器上,CAssembly 助手将安装在 GAC 中,一切正常。在 Azure 中尝试时,问题来了。!
更新 1:
我尝试将代码库提供给 Web 配置文件.. 并且仍然可以工作
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="bin;PrivateFolder"/>
<dependentAssembly>
<assemblyIdentity name="CAssemblyHelper"
publicKeyToken="XXXXXXX"
culture="neutral" />
<codeBase version="1.0.0.0"
href="https://XXXX.scm.azurewebsites.net/api/vfs/SystemDrive/home/site/wwwroot/PrivateFolder/CAssemblyHelper.dll"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
其他错误:
异常:System.IO.FileLoadException
消息:指定的用户没有有效的个人资料。
当我尝试仅检测 System.Configuration.dll 模块时,会出现此异常和消息。
【问题讨论】:
标签: .net azure azure-web-app-service .net-assembly .net-internals