在Razor模板中调试时,当前上下文中不存在变量(不是MVC,没有视图文件夹)

时间:2017-09-30 14:11:59

标签: c# linq json.net razorengine

我使用RazorEngine C#在运行时绑定模板,但在调试时我看不到变量值也没有得到异常。这是我的代码:

    JObject jsonOb = JObject.Parse(modelOutPut); // modelOutPut is JSON string
        JArray brandPerformanceArr = (JArray)jsonOb["STATS"]["BrandProductPerformance"];
        List<ProductPefRec> records = brandPerformanceArr.ToObject<List<ProductPefRec>>();
        string anyVar = "anyvalue";//Debugger here can't see records variable,
   // when I put it in watch , it displays "the name "records" doesn't exist in the current context.

现在几天都在尝试解决这个问题,有什么想法吗?

0 个答案:

没有答案