【发布时间】:2011-06-29 16:50:11
【问题描述】:
我正在尝试调用一个 .net 程序集,该程序集包含来自 Sql Server 的一些 COM 调用(到第三方 dll)。程序集注册良好(我尝试使用不安全和外部访问进行注册),但是当我运行该程序时出现此错误:
在执行用户定义的例程或聚合“ManagedCodeCallTest”期间发生 .NET Framework 错误: System.UriFormatException:无效的 URI:URI 为空。 System.UriFormatException: 在 System.Uri.CreateThis(字符串 uri,布尔值 dontEscape,UriKind uriKind) 在 System.Uri..ctor(字符串 uriString) 在 System.ComponentModel.Design.RuntimeLicenseContext.GetLocalPath(字符串文件名) 在 System.ComponentModel.Design.RuntimeLicenseContext.GetSavedLicenseKey(类型类型,程序集 resourceAssembly) 在 System.ComponentModel.LicenseManager.LicenseInteropHelper.GetCurrentContextInfo(Int32& fDesignTime,IntPtr& bstrKey,RuntimeTypeHandle rth) 在 ManagedCode.MyClass.ArielComponentCall()
有什么想法吗?我正在尝试做的事情甚至可能吗?我阅读了一些关于许可 dll 的信息,但信息非常模糊。
编辑:CLR 代码以防万一:
[SqlProcedure]
public static void ArielComponentCall()
{
Ariel.ApplicationClass application = new Ariel.ApplicationClass();
object arielDoc = application.OpenDocument(@"P:\Projects\COAT\Ariel1.run");
}
包含此类的项目具有对 com 对象的引用。
【问题讨论】:
标签: c# sql-server sqlclr