I’ve been trying to upgrade a Windows 8 Metro App project from the Developer Preview edition of Visual Studio to the Beta of 2011 for much of this morning. Not an easy upgrade path, and I haven’t been able to find much online to help so far. Here are a few notes I’ve found that may be helpful to others.
- The path on the MSBuild WindowsXaml assemblies has changed from v1.0 to v11.0. You can’t even get the project file to open until you edit this. It will kick up an error in the output window, the assembly I needed was Microsoft.Windows.UI.Xaml.CSharp.Targets.dll.
- The IGroupInfo type that used to live in the Windows.UI.Xaml.Data assembly is completely gone.
- So far as I can tell, you’re out of luck if you want to add a service reference. Any time I try to add a reference to the same WCF service that I had been using, it errors out with an extraordinarily descriptive, “Unable to add a data service. Please update project system.” I can only take that to mean a non-Metro application.
I’ll post more of these as I find them. Fun at the bleeding edge…
Because of a recent project, I got to take a closer look at how various types of serialization and deserialization perform in .Net, using the built in serializers. It pitted binary, XML, and JSON versus each other. My guess going in would be that binary would be the fastest, followed by JSON and then XML, following the size of each. That was generally true for serialization, but not for deserialization. XML deserialized faster than JSON, with JSON scaling really badly. Very interesting stuff.
If you have a class library project with WCF service references, any clients (WPF, winforms, etc.) need the settings copied from the app.config of the library. For some reason, the client app.config completely overrides the referenced project rather than inheriting the settings. There’s probably another way, but it works.
I’ll never remember this, so I’ll brain dump it here.
Because iOS formats phone numbers as hyperlinks, I was seeing errors in the IIS event log saying “A potentially dangerous request was detected…” when I was doing an ajax post. The content I was trying to post was just a confirmation, so the phone number was held in a span rather than a textbox. It worked fine on all PC browsers and most mobile devices. Most of the posts I found on Stack Overflow and elsewhere talked about solving it by setting validateRequest on the page level to false. I didn’t want to do this, because I want that added security.
So here’s my fix: add a hidden input that holds the phone number as its value and post that rather than the content from the span.