我試圖調用一個.net程序集,它包裝了一些來自Sql Server的COM調用(第三方DLL)。該組件註冊罰款(我試着用不安全和外部訪問註冊),但是當我運行程序我得到這個錯誤:SQLCLR - 包裝COM調用
A .NET Framework error occurred during execution of user-defined routine or aggregate "ManagedCodeCallTest": System.UriFormatException: Invalid URI: The URI is empty. System.UriFormatException: at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind) at System.Uri..ctor(String uriString) at System.ComponentModel.Design.RuntimeLicenseContext.GetLocalPath(String fileName) at System.ComponentModel.Design.RuntimeLicenseContext.GetSavedLicenseKey(Type type, Assembly resourceAssembly) at System.ComponentModel.LicenseManager.LicenseInteropHelper.GetCurrentContextInfo(Int32& fDesignTime, IntPtr& bstrKey, RuntimeTypeHandle rth) at 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對象的項目。