的app.config不能在SQL Server中的外部组件调用发现能在、组件、发现、app

2023-09-04 04:51:36 作者:你是我的软肋

在SQL Server中,我创建了一个组件来运行一个外部的DLL。当我运行执行我的功能,我就是没有找到我的配置文件例外的存储过程。

In SQL Server ,I created an assembly to run an external DLL. When I run the stored procedure that execute my function I got an exception that my configuration file is not found.

是否有任何人知道在app.config应该位于以便SQL Server知道如何加载它。我有它现在在同一个文件夹我的DLL。

Does any one know where the app.config should be located so that SQL Server knows how to load it. I have it right now in the same folder as my DLL.

在此先感谢。

推荐答案

SQLCLR组件不支持.config文件。为不支持的解决方法,你可以在那里在相同的位置服务二进制文件创建一个sqlservr.exe.config,并把你的配置,SQLCLR组件解析时,组件加载该配置。

SQLCLR assemblies don't support .config files. As an unsupported workaround you can create an sqlservr.exe.config in the same location as the service binaries and place your configuration in there, the SQLCLR assemblies parse this configuration when the assembly is loaded.

 
精彩推荐
图片推荐