哦,更正一下!上面的写错了,应该是这样:
m_oCatalogObject.setProperty("Name",new Object[]{"testapp"});//这句会出错。而上面那句不会出错。为什么会提示参数个数不对呢?

解决方案 »

  1.   

    大笑三声!我搞定了!!!faint,这两天怎么总是这么倒霉?帖子贴上来了,自己又搞定了!可以参考这篇文章:
    http://msdn.microsoft.com/msdnmag/issues/0900/instincts/修改的地方很简单:m_oCatalogObject.setProperty("Value",new Object[]{"Name","testapp"});原因就是上面那篇文章提到的:
    There are a few important things you should know about creating a new COM+ application programmatically. First, while the COMAdminCatalogObject exposes a Name property that holds the application's name and a Key property that holds the application's AppID, you cannot assign values to these properties when you've just created a new application. Instead, you must use the Value property to assign these attributes, as shown in Figure 3. However, once a COM+ application has a name and an AppID, you can query the Name and Key properties to obtain their values.