Posts

Showing posts from 2011

"Excuse me, sir, there seem to be something wrong with your markup"

Error : System.Exception occurred   Message=Unspecified error   StackTrace:        at MS.Internal.XcpImports.CheckHResult(UInt32 hr)        at MS.Internal.XcpImports.UIElement_Measure_WithDesiredSize(UIElement element, Size availableSize)        at System.Windows.UIElement.Measure_WithDesiredSize(Size availableSize)        at System.Windows.Controls.VirtualizingStackPanel.MeasureChild(UIElement child, Size layoutSlotSize)        at System.Windows.Controls.VirtualizingStackPanel.MeasureOverride(Size constraint)        at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Double inWidth, Double inHeight, Double& outWidth, Double& outHeight)        at MS.Internal.XcpImports.MeasureOverrideNative(IntPtr element, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)        at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize)        at System.Windows.FrameworkElement.MeasureOver

Reference cannot be added to ... because it was not built using the Windows Phone runtime.

Image
Bummer! But it's a POCO ! Since I owned the code in question, I could solve the issue by creating a new project in my CookieManagement-project, called Wp7 that specifically targeted the Windows Phone 7 runtime: See those shortcut overlays on the code files in the Wp7-project? Those files are actually symbolic links to the files in the owning project, meaning I only have to manage one copy of the file. I think I picked that trick up from a .NET Rocks show: Oh ... the project referenced in this article primarilly helps you manage HTTP Cookies in a Windows Phone 7 application. For more information about the project, please visit its CodePlex project site .

JSON-deserialization in .NET

If you're working with  ASP.NET   MVC  (an excellent framework), passing JSON-data from  your views to your Controllers is a magic experience - the JSON-objects are automatically serialized to their .NET representations, as long as you have the same field/property names.   However, if you want to parse data outside of the magical web world - say you'd like to parse JSON-data from your Windows Phone application - you're out of luck. Unless ...  To parse JSON-data, I initially tried the DataContractJsonSerializer, since I prefer using the plain/native Microsoft .NET framework whenever possible. I quickly ran into issues though, finding that it simply did not work for my purposes. After som  web scurrying , I found  Newtonsoft's Json-parser  and fell in love: Data Contract:     [DataContract]      public class LinkItem     {         [DataMember]          public string Headline  { get; set; }         [DataMember]          public string Abstract  {

"There is no server by the specified name"

If you've previously used the Visual Studio 2008 Remote Debugging feature and you're now trying it again with Visual Studio 2010, a server response of "There is no server by the specified name" might indicate that you will need to copy the new Remote Debugger to your server and run that, instead of your old one. Copy Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Remote Debugger onto your server and execute the msvsmon of the appropriate architecture (likely x64).

Silverlight Business Application - blank page

Issue : You kick-start your modified Silverlight Business Application using F5 in Visual Studio. Google Chrome, your default web browser, starts loading your Silverlight application. The debugger detaches. No breakpoints were hit. Solution : In Google Chrome, klick Wrench - Tools - Remove web information (Ctrl+Shift+Del).