創建了一個com+編譯成功,可卻在2000無件服務中找不到我的com組件。 看看有什麼錯誤。using System; using System.EnterpriseServices; using System.Reflection; [assembly: ApplicationName("myComponent")] [assembly: AssemblyKeyFileAttribute("..\\..\\myComponent.snk")] namespace myComponent { [Transaction(TransactionOption.Required)] public class First : ServicedComponent { [AutoComplete] public string GetStr(string str) { return str + "is ok !"; } } }編譯都沒問題。
看了別人的貼子。原來還少了個 regsvcs dll文件名
那是OS的问题吧! 用2000的 advance server版
Microsoft (R) .NET Framework Services Installation Utility Version 1.0.3705.0 Copyright (C) Microsoft Corporation 1998-2001. All rights reserved.警告: 類別 'myComponent.First' 沒有類別介面,這表示 Unmanaged 晚期繫結呼叫不能使 用 AutoComplete 方法。 已安裝的組件: 組件: C:\Documents and Settings\Administrator\My Documents\Visual Studio Projects\ClassLibrary6\bin\Debug\myComponent.dll 應用程式: myComponent 型別程式庫: c:\documents and settings\administrator\my documents\visual studio projects\classlibrary6\bin\debug\myComponent.tlb這樣的結果對嗎?
為什麼我的.net 找不到這個EnterpriseServices
你可以在工程中添加对给.dll的应用!
.NET 中有就是System.EnterpriseServices
看看有什麼錯誤。using System;
using System.EnterpriseServices;
using System.Reflection; [assembly: ApplicationName("myComponent")]
[assembly: AssemblyKeyFileAttribute("..\\..\\myComponent.snk")]
namespace myComponent
{
[Transaction(TransactionOption.Required)]
public class First : ServicedComponent
{
[AutoComplete]
public string GetStr(string str)
{
return str + "is ok !";
}
}
}編譯都沒問題。
regsvcs dll文件名
用2000的 advance server版
Copyright (C) Microsoft Corporation 1998-2001. All rights reserved.警告: 類別 'myComponent.First' 沒有類別介面,這表示 Unmanaged 晚期繫結呼叫不能使
用 AutoComplete 方法。
已安裝的組件:
組件: C:\Documents and Settings\Administrator\My Documents\Visual Studio
Projects\ClassLibrary6\bin\Debug\myComponent.dll
應用程式: myComponent
型別程式庫: c:\documents and settings\administrator\my documents\visual
studio projects\classlibrary6\bin\debug\myComponent.tlb這樣的結果對嗎?