问题
If I wrote:
IList<Video> videoContainer = videos.ToList();
DateTime theData = videoContainer.First().YouTubeEntry.Published;
the code works perfectly.
But if I go in Debug mode and I analyze videoContainer expanding the fields, I can't see that field Published
.
Why?
回答1:
It works a lot easier when you grab the item of interest first
IList<Video> videoContainer = videos.ToList();
var entry = videoContainer.First().YouTubeEntry; // debug 'entry'
DateTime theData = entry.Published;
回答2:
Just a quick guessing, maybe you have some problem with build configuration setting. You can see the current setting at Visual studio menu: Build->Configuration Manager.
Just to make sure, do Build->Batch Build before doing the test. If you are using ASP.Net, make sure that the web (virtual folder in IIS, and site link) you use already refer to the latest code. It is just to make sure that your tested items will be the latest.
来源:https://stackoverflow.com/questions/15336824/why-on-debug-some-field-are-missing