Windows Phone 7 응용 프로그램을 Windows Phone 8에 포팅하기 시작하여 ListBox에서 결과를 얻지 못하고 있음을 알았습니다. 정상적으로 실행되면 내 코드는 코드의 "새로운 ActiveItem"부분으로 들어갈 때만 예외를 throw합니다. XML이 반환되고 요소가 정확하다는 것을 확인했지만 이전에는 본 적이 없습니다. 어떤 제안? ! System.AccessViolationException이 처리되지 않았습니다. C# Windows Phone 8
BeActive.DLL BeActive.MainPage.activeweb_DownloadStringCompleted.AnonymousMethod__1 (에서 System.Xml : 여기여기 예외의 호출 스택이 ActiveItemEventsListBox.ItemsSource = from activeweb in xmlItems.Descendants("meta") select new ActiveItem { ActEvent = activeweb.Element("assetName").Value.Trim(), Date = activeweb.Element("city").Value + ", " + activeweb.Element("Eventstate").Value + Environment.NewLine + Convert.ToDateTime(activeweb.Element("startDate").Value).ToLongDateString(), City = activeweb.Element("city").Value, StartTime = activeweb.Element("startTime").Value, AssetId = activeweb.Element("assetId").Value.Trim() };
public class ActiveItem { public string ActEvent { get; set; } public string Date { get; set; } public string State { get; set; } public string City { get; set; } public string StartTime { get; set; } public string AssetId { get; set; } }
생성자이다. Linq.XElement activeweb) 줄 97 C#
ActiveItem 클래스에 기본 생성자가 있습니까? – kindasimple
예외의 전체 호출 스택을 추가 할 수 있습니까? 내가 ActiveItem 을 구성하고 방법은 다음과 –
이다 ' 공용 클래스 ActiveItem { 공공 문자열 ActEvent {얻을; 세트; } public string Date {get; 세트; } public string State {get; 세트; } public string 도시 {get; 세트; } 공개 문자열 StartTime {get; 세트; } public string AssetId {get; 세트; } } ' – HarryM