本文介绍了构建错误,没有消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我收到了构建错误,但它没有给我一个 错误消息。我知道它与以下 代码行有关。可能是什么问题以及为什么我不能获得错误消息?谢谢。 for(int i = 0; i< = detailView1.Items.Count - 1; i ++) { if(detailView1.Items [i] .GetType()。ToString()。EndsWith (" ItemDateTime")) { if advancedList1.SelectedRow [detailView1.Items [i] .Name] .ToString()<> " detailView1.Items [i] .Value = advancedList1.SelectedRow [detailView1.Items [i] .Name] else detailView1.Items [i] .Value = advancedList1.SelectedRow [detailView1.Items [i] .Name] } { detailView1.Items [i] .Value = advancedList1.SelectedRow [detailView1。 Items [i] .Name]; } } 解决方案 - 每个if-expression必须有 左右的条件。 - 所有句子必须以分号结尾 - 在C#中我们使用!=而不是<> // Bjorn A 。 I am getting a build error but it doesn''t give me anerror message. I know it has to do with the followingline of code. What could be the problem and why don''t Iget an error message? Thanks. for (int i = 0; i <= detailView1.Items.Count - 1; i++){if (detailView1.Items[i].GetType().ToString().EndsWith("ItemDateTime")){if advancedList1.SelectedRow[detailView1.Items[i].Name].ToString() <> "" detailView1.Items[i].Value =advancedList1.SelectedRow[detailView1.Items[i].Name]else detailView1.Items[i].Value =advancedList1.SelectedRow[detailView1.Items[i].Name]}{ detailView1.Items[i].Value =advancedList1.SelectedRow[detailView1.Items[i].Name]; }} 解决方案 - Every if-expression must haveparantheses around the condition. - All sentences must end with semicolon - In C# we use "!=" instead of "<>" // Bjorn A. 这篇关于构建错误,没有消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
09-18 13:49