我正在调用服务参考
using (FeeService.FeeSvcClient svc = new FeeService.FeeClient())
{
response = svc.Retrieve(arg);
}
然而,当从FeeService端调试时,arg参数变为
“无法获取本地或参数'args'的值,因为它在此指令指针处不可用,可能是因为它已被优化掉了。”
但是当传递两个字母的代码时,该值实际上为null。这是定义。
public void Retrieve(Dictionary<string, string> arg, out string docVariables)
{
if (null != _calc)
_calc = null;
docVariables = string.Empty;
if (string.IsNullOrEmpty(_stateAbbreviation) == false)
{
string transType = "", vehClass = "", vehUse = "", dealType = "", purchaseStateCode = "";
arg.TryGetValue("StateCode", out purchaseStateCode);
arg.TryGetValue("trans", out transType);
arg.TryGetValue("Class", out vehClass);
arg.TryGetValue("Use", out vehUse);
arg.TryGetValue("deal", out dealType);
docVariables = Utility.GetDocument(_stateAbbreviation, transType, vehClass, vehUse, dealType, purchaseStateCode);
}
}
我已经尝试了所有六种方法来关闭优化代码:
1. Checking off the optimized code in the build tab for project
properties.
2. Setting debug info mode to full in advance option of the build tab.
3. Turning off Visual Studio hosting process in the debug tab
4. Checking if the active solution configuration is in debug and not release.
5. Clean and rebuilt the solution.
6. Doesn't appear I can check if the module is optimized since this is a service reference.