2010-03-06 79 views
1

我有一个用C#编写的函数,它有一个参数类型Dictionary<string , string>。当我尝试在VB.Net中调用此函数时,它不显示类型为Dictionary<string , string>它显示为string。下面是我的函数将函数参数调用为泛型字典从C#到vb.net中的问题

public bool RegisterCustomerAttribute(int CustomerId 
              , Dictionary<string , string> dictAttribute) 
    { 
     try 
     { 

      List<string> keys = new List<string>(dictAttribute.Keys); 

      foreach (string key in keys) 
      { 
       CustomerAttribute custattr = new CustomerAttribute(); 

       custattr.Customer.CustomerID = CustomerId; 
       custattr.Key = key; 
       custattr.Value = dictAttribute[key]; 

       customerattrepo.AddCustomerAttribute(custattr); 

      } 

      return true; 
     } 
     catch (Exception ex) 
     { 
      string strMsg = ex.Message; 
      return false; 
     } 
    } 

alt text http://i46.tinypic.com/qsv6fa.png

+2

您是否在旧签名到新签名的某个时刻更改了'RegisterCustomerAttribute'方法?您必须重建C#项目才能显示在您的VB.NET代码中。 – 2010-03-06 16:06:08

+0

你是200%的权利。我身边的小错误.. – 2010-03-06 17:30:29

回答

0

起初我以为可能有一个重载,只需要一个键和值,但是你会看到至少在智能感知了这一个选项。所以,相反,我敢打赌它正在寻找旧的或过时的代码—,您需要在Visual Studio中的VB项目中重新加载对c#项目的引用。