<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Bart Lannoeye - Blog</title><link>http://www.bartlannoeye.be:80/blog</link><description>Bart Lannoeye - Blog</description><item><title>Adding NuGet packages to a Portable Class Library</title><link>http://www.bartlannoeye.be:80/blog/adding-nuget-packages-to-a-portable-class-library</link><description>&lt;p&gt;This weekend I planned to set up a &lt;a href="http://msdn.microsoft.com/en-us/library/gg597391.aspx" target="_blank"&gt;Portable Class Library&lt;/a&gt; (PCL) with shared code between our Windows 8 and Windows Phone projects. Since async isn&amp;rsquo;t supported on Windows Phone 7 by default, the first task was adding the &lt;a href="http://www.microsoft.com/en-us/download/details.aspx?id=29576" target="_blank"&gt;Async Targeting Pack&lt;/a&gt;. This enables projects targeting .NET 4.0 or Silverlight 5 to use the async language features. A &lt;a href="https://nuget.org/packages/Microsoft.Bcl.Async/1.0.12-beta" target="_blank"&gt;newer version&lt;/a&gt; on NuGet also includes Silverlight 4 and Windows Phone 7.5. So my first task was to add this latest version through NuGet, but I got greeted with following error message:&lt;/p&gt;
&lt;pre&gt;Could not install package 'Microsoft.Bcl 1.0.11-beta'. You are trying to install this package
into a project that targets '.NETPortable,Version=v4.0,Profile=Profile4', but the package does
not contain any assembly references that are compatible with that framework.
For more information, contact the package author.&lt;/pre&gt;
&lt;p&gt;If you look at this &lt;a href="http://nitoprograms.blogspot.be/2012/05/framework-profiles-in-net.html" target="_blank"&gt;list of framework profiles&lt;/a&gt;, you&amp;rsquo;ll see that Profile 4 equals to .NET 4.5, Silverlight 4 and Windows Phone 7 while the bcl package requires Windows Phone 7.5 (or SKD 7.1). After changing the PCL project properties I still had a similar error message and trying to add JSON.NET gave me an error message as well. Digging a bit deeper I found out that I still had NuGet 2.0 while you&amp;rsquo;ll need NuGet 2.1 (or higher) for PCL support.&lt;/p&gt;
&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;Make sure that you have the latest NuGet version installed and check that your Portable Class Library target frameworks are similar or higher than those required by the package.&lt;/p&gt;</description><pubDate>Sun, 28 Oct 2012 14:51:32 GMT</pubDate><guid isPermaLink="true">http://www.bartlannoeye.be:80/blog/adding-nuget-packages-to-a-portable-class-library</guid></item><item><title>Office 2013 Preview change temperature to Celcius</title><link>http://www.bartlannoeye.be:80/blog/office-2013-preview-change-temperature-to-celcius</link><description>&lt;p&gt;A new adition to Office 2013 (Preview) is showing the weather of a choosen city in the calendar view. Today it's foggy with a maximum temperature of 76&amp;deg; Fahrenheit.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://www.bartlannoeye.be/Media/Default/BlogPost/images/Office2013PreviewTemperature.png" alt="Office 2013 temperature" width="444" height="88" /&gt;&lt;/p&gt;
&lt;p&gt;Even though I'm planning a trip to the States next year, I'm not used to using Fahrenheit and want to see my temperature in degrees Celcius. In the Options window, find the Calendar tab and scroll down to the bottom.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://www.bartlannoeye.be/Media/Default/BlogPost/images/Office2013PreviewTemperatureOptions.png" alt="Office 2013 Temperature Options" width="840" height="685" /&gt;&lt;/p&gt;</description><pubDate>Tue, 04 Sep 2012 08:19:35 GMT</pubDate><guid isPermaLink="true">http://www.bartlannoeye.be:80/blog/office-2013-preview-change-temperature-to-celcius</guid></item><item><title>VS 2012 running tests after each build</title><link>http://www.bartlannoeye.be:80/blog/vs-2012-running-tests-after-each-build</link><description>&lt;p&gt;A nice feature of Visual Studio 2012 (Premium or Ultimate) is the possibility to automatically run unit tests after each build. Open the &lt;strong&gt;Test Explorer Window&lt;/strong&gt; (Under Test &amp;gt; Windows) and enable the first button in the window's menu bar: "Run Tests After Build". Whenever you build your solution (F6), all your unit tests will run automatically and asynchronously, so you can continue working. Great for some TDD!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://www.bartlannoeye.be/Media/Default/BlogPost/images/VS2012RunTestsAfterEachBuild.png" alt="VS 2012 run tests after each build" height="103" width="305" /&gt;&lt;/p&gt;</description><pubDate>Tue, 28 Aug 2012 10:43:33 GMT</pubDate><guid isPermaLink="true">http://www.bartlannoeye.be:80/blog/vs-2012-running-tests-after-each-build</guid></item><item><title>Our session at #ComDayBe</title><link>http://www.bartlannoeye.be:80/blog/our-session-at-comdaybe</link><description>&lt;p&gt;Yesterday &lt;a href="http://depblog.weblogs.us/" target="_blank"&gt;Glenn&lt;/a&gt; (&lt;a href="https://twitter.com/Depechie" target="_blank"&gt;twitter&lt;/a&gt;) and I presented a session on &amp;ldquo;Building the Windows 8 Community App&amp;rdquo; at &lt;a href="http://www.communityday.be/" target="_blank"&gt;Community Day 2012&lt;/a&gt; as members of the &lt;a href="http://www.wiphug.be" target="_blank"&gt;Belgian Windows Phone User Group&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;During the session we gave a preview of the (soon to be official) Belgian Community App, together with several technical items and some best practices. Since we&amp;rsquo;re still finetuning some parts of the app, we&amp;rsquo;ll be putting a series of blog posts online with code samples and more detailed explanations. You can find the &lt;a href="http://www.slideshare.net/bartlannoeye/building-the-windows-8-community-app" target="_blank"&gt;slides of the presentation&lt;/a&gt; on slideshare. Some of the topics we touched and on which we&amp;rsquo;ll blog are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a title="Consuming JSON data in WinRT" href="http://www.bartlannoeye.be/blog/consuming-json-data-in-winrt"&gt;Consuming JSON data in WinRT&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Lazy loading your data with MVVM&lt;/li&gt;
&lt;li&gt;Using Bing Maps with MVVM in Windows 8&lt;/li&gt;
&lt;li&gt;&lt;a href="http://depblog.weblogs.us/2012/06/22/comdaybe-image-manipulation-in-windows-8-metro-app/" target="_blank"&gt;Image manipulation in Windows 8 metro app&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a target="_blank" title="Flyout control in XAML for Windows 8" href="http://depblog.weblogs.us/2012/06/28/comdaybe-flyout-control-in-xaml-through-callisto-for-windows-8/"&gt;Flyout control in XAML for Windows 8&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://depblog.weblogs.us/2012/06/26/comdaybe-share-contract-through-mvvm-in-windows-8/" target="_blank"&gt;Share contract through MVVM in Windows 8&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a title="XAML binding resources from a separate assembly" href="http://www.bartlannoeye.be/blog/xaml-binding-resources-from-a-separate-assembly"&gt;XAML binding resources from a separate assembly&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description><pubDate>Fri, 03 Aug 2012 08:51:18 GMT</pubDate><guid isPermaLink="true">http://www.bartlannoeye.be:80/blog/our-session-at-comdaybe</guid></item><item><title>Consuming JSON data in WinRT</title><link>http://www.bartlannoeye.be:80/blog/consuming-json-data-in-winrt</link><description>&lt;p&gt;Following the &lt;a href="http://www.bartlannoeye.be/blog/our-session-at-comdaybe"&gt;session&lt;/a&gt; that &lt;a href="http://depblog.weblogs.us/" target="_blank"&gt;Glenn&lt;/a&gt; (&lt;a href="https://twitter.com/Depechie" target="_blank"&gt;twitter&lt;/a&gt;) and I presented at &lt;a href="http://www.communityday.be/" target="_blank"&gt;Community Day 2012&lt;/a&gt; as members of the &lt;a href="http://www.wiphug.be" target="_blank"&gt;Belgian Windows Phone User Group&lt;/a&gt;, we&amp;rsquo;re writing a couple of posts explaining the topics and showing some code. The topic of today is consuming JSON in WinRT apps.&lt;/p&gt;
&lt;p&gt;Before WinRT you could use the WebClient class to access your JSON APIs, but this class isn&amp;rsquo;t available for Windows 8 Metro applications. For these kind of applications you&amp;rsquo;ll have to use the new &lt;a href="http://msdn.microsoft.com/en-us/library/system.net.http.httpclient%28v=vs.110%29.aspx" target="_blank"&gt;HttpClient&lt;/a&gt; class in combination with the async/await keywoards for asynchronous web access. The GetAsync() methods returns a HttpResponseMessage containing the returned status code, response headers and content.&lt;/p&gt;
&lt;pre class="brush: csharp;"&gt;public async Task&amp;lt;string&amp;gt; GetJsonString()
{
    HttpClient client = new HttpClient();
    string url = "http://urltoyourApi";
    HttpResponseMessage response = await client.GetAsync(url);
    return response.Content.ReadAsString();
}
&lt;/pre&gt;
&lt;p&gt;In case you need extra tinkering of your web requests or responses, you can inject your own MessageProcessingHandler in the HttpClient, although this shouldn&amp;rsquo;t be needed for most scenarios.&lt;/p&gt;
&lt;pre class="brush: csharp;"&gt;HttpMessageHandler handler = new HttpClientHandler();
handler = new MyMessageProcessingHandler(handler);
var HttpClient = new HttpClient(handler);
HttpClient.BaseAddress = serviceUri;
HttpClient.MaxResponseContentBufferSize = 100000;
&lt;/pre&gt;
&lt;pre class="brush: csharp;"&gt;/// &amp;lt;summary&amp;gt;
/// In case you need to customize request/response
/// &amp;lt;/summary&amp;gt;
public class MyMessageProcessingHandler : MessageProcessingHandler
{
    public MyMessageProcessingHandler(HttpMessageHandler innerHandler)
        : base(innerHandler)
    {
    }

    // Process the request before sending it
    protected override HttpRequestMessage ProcessRequest(HttpRequestMessage request,
         CancellationToken cancellationToken)
    {
        if (request.Method == HttpMethod.Get)
        {
            request.Headers.Add("Custom-Header", "CustomRequestValue");
        }
        return request;
    }

    // Process the response before returning it to the user
    protected override HttpResponseMessage ProcessResponse(HttpResponseMessage response,
         CancellationToken cancellationToken)
    {
        if (response.RequestMessage.Method == HttpMethod.Get)
        {
            response.Headers.Add("Custom-Header", "CustomResponseValue");
        }
        return response;
    }
}
&lt;/pre&gt;
&lt;h2&gt;Parsing the JSON string&lt;/h2&gt;
&lt;p&gt;For the second part of your job, parsing the JSON string into an object, there is another new class available in .NET 4.5: &lt;a href="http://msdn.microsoft.com/en-us/library/system.json.jsonobject%28v=vs.110%29.aspx" target="_blank"&gt;JsonObject&lt;/a&gt;. You can feed the returned string into this class by using the constructor or the Parse() method. An exception will be thrown if the JSON string is invalid and can&amp;rsquo;t be parsed correctly. Once the parsing is done, the JsonObject behaves like a sort of dictionary from which you can get values by string indexers or methods.&lt;/p&gt;
&lt;pre class="brush: csharp;"&gt;public async void DoSomeParsing()
{
    string responseText = await GetJsonString();
    JsonObject root = new JsonObject(responseText);

    // parse properties
    bool isSuccess = root.GetNamedString("status") == "ok"; // get string
    string type = root["type"].GetString(); // get string with indexer
    int size = (int)root.GetNamedNumber("size"); // get int
    JsonObject subObject = root.GetNamedObject("someSubObject"); // get another json object
}
&lt;/pre&gt;
&lt;p&gt;This approach is fine if you need only a few properties out of your JSON tree, but can get quite cumbersome for large trees plus you don&amp;rsquo;t have any IntelliSense available for all the property names. You can still fall back on the &lt;a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.json.datacontractjsonserializer.aspx" target="_blank"&gt;DataContractJsonSerializer&lt;/a&gt;, which is moved to the System.Runtime.Serialization assembly. You will also have to define the correct classes to be able to deserialize, but there are tools like &lt;a href="http://json2csharp.com/" target="_blank"&gt;json2csharp&lt;/a&gt; available to help you with that part. The deserialized result is a nice C# object tree.&lt;/p&gt;
&lt;pre class="brush: csharp;"&gt;public async void DoSomeDeserializing()
{
    string responseText = await GetJsonString();
     
    DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(MyRootObject));
    using (MemoryStream stream = new MemoryStream(Encoding.Unicode.GetBytes(responseText)))
    {
        var rootObject = serializer.ReadObject(stream) as MyRootObject;
    }
}
&lt;/pre&gt;
&lt;p&gt;But my favorite library for JSON manipulations is still &lt;a href="http://json.codeplex.com/" target="_blank"&gt;JSON.NET&lt;/a&gt;. This library allows you to serialize and deserialize with a single line of code, directly to the objects you defined. You can again use json2csharp to create your model, if you don&amp;rsquo;t have it available yet. Since our API for the Community Day demo was uniform for all types, I provided both a generic method that retrieves a single item and one that returns a collection of items.&lt;/p&gt;
&lt;pre class="brush: csharp; highlight: [10];"&gt;public async Task&amp;lt;T&amp;gt; GetItem(string someUri)
{
    T resultItem = new T();

    HttpResponseMessage response = await HttpClient.GetAsync(someUri);
    if (response.StatusCode == HttpStatusCode.OK)
    {
        string responseString = await response.Content.ReadAsStringAsync();
        // parse to json
        resultItem = JsonConvert.DeserializeObject&amp;lt;T&amp;gt;(responseString);
    }
    else
    {
        throw new Exception(response.StatusCode.ToString() + " " + response.ReasonPhrase);
    }

    return resultItem;
}
&lt;/pre&gt;
&lt;p&gt;Up to you which of the 3 possibilities you pick for your implementation, good luck !&lt;/p&gt;</description><pubDate>Thu, 02 Aug 2012 15:47:10 GMT</pubDate><guid isPermaLink="true">http://www.bartlannoeye.be:80/blog/consuming-json-data-in-winrt</guid></item><item><title>XAML binding resources from a separate assembly</title><link>http://www.bartlannoeye.be:80/blog/xaml-binding-resources-from-a-separate-assembly</link><description>&lt;p&gt;Following the &lt;a href="http://www.bartlannoeye.be/blog/our-session-at-comdaybe"&gt;session&lt;/a&gt; that &lt;a href="http://depblog.weblogs.us/" target="_blank"&gt;Glenn&lt;/a&gt; (&lt;a href="https://twitter.com/Depechie" target="_blank"&gt;twitter&lt;/a&gt;) and I presented at &lt;a href="http://www.communityday.be/" target="_blank"&gt;Community Day 2012&lt;/a&gt; as members of the &lt;a href="http://www.wiphug.be" target="_blank"&gt;Belgian Windows Phone User Group&lt;/a&gt;, we&amp;rsquo;re writing a couple of posts explaining the topics and showing some code.&lt;/p&gt;
&lt;p&gt;In this post we&amp;rsquo;re handling the use of resources in your Windows 8 Metro application. As your Windows 8 application can be made available word-wide through the marketplace, there&amp;rsquo;s no discussion that you should localize the app to target this global market.&lt;/p&gt;
&lt;p&gt;Before Windows 8, if you were doing XAML development (WPF, Silverlight or Windows Phone), you could use &lt;a href="http://timheuer.com/blog/archive/2009/08/26/silverlight-string-localization.aspx" target="_blank"&gt;data binding techniques&lt;/a&gt; to do the mapping from the RESX-generated class to the XAML UI. By placing the resource reference at the application level (App.xaml) it wasn&amp;rsquo;t too hard to do your localization. But now with Windows 8, it got even a lot easier: the app already loads your resource files and there&amp;rsquo;s a new way of binding in XAML using the x:Uid attribute.&lt;/p&gt;
&lt;pre class="brush: xml;"&gt;&amp;lt;TextBlock x:Uid="SomeText" Margin="0,0,18,0" Style="{StaticResource BodyTextStyle}"/&amp;gt;
&lt;/pre&gt;
&lt;p&gt;What this line of XAML code tells is: go look in the resources, now stored in a &lt;strong&gt;RESW&lt;/strong&gt; file, and find me the key &amp;lsquo;SomeText&amp;rsquo;. But that&amp;rsquo;s only part of the story! Resource keys can now be build up out of 2 parts like &lt;em&gt;SomeText.Text&lt;/em&gt;, but also &lt;em&gt;SomeText.Width&lt;/em&gt; or any other property available on your XAML control, including attached properties. By using the &lt;strong&gt;x:Uid&lt;/strong&gt; attribute on the control, all available properties starting with the key are merged from the resources into your UI.&lt;/p&gt;
&lt;p&gt;&lt;img title="" alt="Windows 8 Resource file" src="http://www.bartlannoeye.be/Media/Default/BlogPost/images/Win8ResourcesFile1.png" /&gt;&lt;/p&gt;
&lt;p&gt;Everything is quite straightforward if all your resources are in the same assembly as your XAML views, but things start to get more difficult if you offload your resources to a separate assembly as these resources aren&amp;rsquo;t automatically merged into your application&amp;rsquo;s resources. In the sample code attached below, there&amp;rsquo;s a solution with 2 projects, both containing part of the resource files for the languages English (en) and Dutch (nl).&lt;/p&gt;
&lt;p&gt;&lt;img title="" alt="Windows 8 Resources example project structure" src="http://www.bartlannoeye.be/Media/Default/BlogPost/images/Win8ResourcesProjectStructure1.png" /&gt;&lt;/p&gt;
&lt;p&gt;The first solution to access the resources in the OffloadingResources.Resources assembly is to retrieve them through C# code and push them into the correct properties.&lt;/p&gt;
&lt;pre class="brush: csharp;"&gt;public static class LocalizedNamesLibrary
{
    static ResourceLoader _resourceLoader = null;

    public static string GetResourceValue(string resourceName)
    {
        if (_resourceLoader == null)
        {
            _resourceLoader = new ResourceLoader("OffloadingResources.Resources/Resources");
        }
        return _resourceLoader.GetString(resourceName);
    }
}
&lt;/pre&gt;
&lt;p&gt;All this code does is providing a simple static method that returns the value of a given key. It&amp;rsquo;s easy and it works, right? But what about the newly given powers to automatically bind all attached properties of a given element? For that we have to tell our app that it has to go fetch the Resources of the OffloadingResources.Resources assembly and bind to the AppTitle key, which translates to:&lt;/p&gt;
&lt;pre class="brush: xml;"&gt;&amp;lt;TextBlock x:Uid="/OffloadingResources.Resources/Resources/AppTitle" .. /&amp;gt;&lt;/pre&gt;
&lt;p&gt;Once you have this in place, it&amp;rsquo;s quite easy to localize your app into multiple languages. Next to that you can even leverage the fact that the whole resource system built into Windows 8 not only knows your language and culture, but also the scale and color contrast in which the app runs. This enables you to provide the correct font and image sizes, text and (localized) images to make your app ready for the global marketplace.&lt;/p&gt;
&lt;h2&gt;Extra note&lt;/h2&gt;
&lt;p&gt;Testing for multiple languages can be hard and different languages also do have impact on the size of your controls (e.g. buttons) or the way Unicode characters are shown. To help you test, Windows has a concept of pseudo-localization (and a &lt;a href="http://blogs.msdn.com/b/michkap/archive/2011/04/11/10152035.aspx" target="_blank"&gt;lot of the Windows builds are done on pseudo&lt;/a&gt;). By default this is not enabled, so you&amp;rsquo;ll have to go dig in your Windows registry at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\Locale. Down there add the following &lt;strong&gt;string values&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img title="" alt="Windows 8 pseudo locale keys" src="http://www.bartlannoeye.be/Media/Default/BlogPost/images/Win8PseudoLocale.png" /&gt;&lt;/p&gt;
&lt;p&gt;This will result in the following 3 locales for testing:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Base&lt;/strong&gt;: &lt;em&gt;qps-ploc&lt;/em&gt; locale is used for English-like pseudo localizations. Its strings are longer versions of English strings, using non-Latin and accented characters instead of the normal script. Additionally simple Latin strings should sort in reverse order with this locale.&lt;br /&gt;&lt;strong&gt;Mirrored&lt;/strong&gt;: &lt;em&gt;qpa-mirr&lt;/em&gt; is used for right-to-left pseudo data, which is another area of interest for testing.&lt;br /&gt;&lt;strong&gt;East Asian&lt;/strong&gt;: &lt;em&gt;qps-asia&lt;/em&gt; is intended to utilize the large CJK character repertoire, which is also useful for testing.&lt;/p&gt;
&lt;p&gt;Next up change your regional settings to one of these locales.&lt;br /&gt;Don't change the system locale itself or you'll be greeted with a nice error during your next boot, resulting in a &lt;a href="http://superuser.com/questions/110210/how-to-edit-registry-from-vista-recovery-tool" target="_blank"&gt;manual fix of the registry&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img title="" alt="Windows 8 pseudo locale region" src="http://www.bartlannoeye.be/Media/Default/BlogPost/images/Win8PseudoLocaleRegion1.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img title="" alt="Windows 8 pseudo locale region" src="http://www.bartlannoeye.be/Media/Default/BlogPost/images/Win8PseudoLocaleRegion2.png" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Example code: &lt;a href="http://sdrv.ms/KOnanF" target="_blank"&gt;OffloadingResources.zip&lt;/a&gt;&lt;br /&gt;&lt;em&gt;Disclaimer: source code was written in Visual Studio 2012 RC&lt;/em&gt;&lt;/p&gt;</description><pubDate>Thu, 28 Jun 2012 14:37:27 GMT</pubDate><guid isPermaLink="true">http://www.bartlannoeye.be:80/blog/xaml-binding-resources-from-a-separate-assembly</guid></item><item><title>Microsoft announced a new Surface in the form of a tablet</title><link>http://www.bartlannoeye.be:80/blog/microsoft-announced-a-new-surface-in-the-form-of-a-tablet</link><description>&lt;p&gt;As some of you might know, Microsoft had an event planned for a secret announcement today, a bit similar to Apple's product launches (with the difference that they could prevent any leaks).&lt;/p&gt;
&lt;p&gt;During the event they announced a new Surface device, being an actual tablet ... but with some very interesting features:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;integrated kickstand&lt;/li&gt;
&lt;li&gt;integrated keyboard in the cover&lt;/li&gt;
&lt;li&gt;VaporMg case (yes, that's Magnesium)&lt;/li&gt;
&lt;li&gt;has a real pen&lt;/li&gt;
&lt;li&gt;available for both Windows RT as the full blown Windows 8 Pro&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;More info on the Surface can be found on &lt;a href="http://www.microsoft.com/surface/en/us/default.aspx" target="_blank"&gt;http://www.microsoft.com/surface/en/us/default.aspx&lt;/a&gt;&amp;nbsp;(specs under the About tab). There's also a promotional video on the site.&lt;/p&gt;</description><pubDate>Mon, 18 Jun 2012 23:54:29 GMT</pubDate><guid isPermaLink="true">http://www.bartlannoeye.be:80/blog/microsoft-announced-a-new-surface-in-the-form-of-a-tablet</guid></item><item><title>We'll be speaking at the Belgian Community Day 2012</title><link>http://www.bartlannoeye.be:80/blog/we-ll-be-speaking-at-the-belgian-community-day-2012</link><description>&lt;p&gt;This morning the full calendar for the Belgian &lt;a target="_blank" href="http://www.communityday.be/"&gt;Community Day 2012&lt;/a&gt; has been released. It will take place on June 21st 2012 in Mechelen and is an event organized by 17 Belgian user groups!&lt;/p&gt;
&lt;p&gt;Together with &lt;a target="_blank" href="http://depblog.weblogs.us/"&gt;Glenn&lt;/a&gt;, I'll be kicking off the Windows 8 track demonstrating how to build an end-to-end application on Windows 8. Keep an eye on our blogs and twitter for more teasers and we hope to see you all there.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://www.bartlannoeye.be/Media/Default/BlogPost/images/ComDay2012-imaspeaker.png" alt="" height="200" width="200" /&gt;&lt;/p&gt;</description><pubDate>Mon, 07 May 2012 11:42:10 GMT</pubDate><guid isPermaLink="true">http://www.bartlannoeye.be:80/blog/we-ll-be-speaking-at-the-belgian-community-day-2012</guid></item><item><title>First Belgian Windows Phone User Group session</title><link>http://www.bartlannoeye.be:80/blog/first-belgian-windows-phone-user-group-session</link><description>&lt;p&gt;Yesterday we kicked off the Belgian &lt;a target="_blank" href="http://www.wiphug.be"&gt;Windows Phone User Group (WiPhug)&lt;/a&gt; with a first event called 'Building a Windows Phone application from Z to A'. We started with a short introduction of the team behind WiPhug, our intentions for the community and of course the session itself, given by &lt;a target="_blank" href="http://modul8com.wordpress.com/"&gt;Michael&lt;/a&gt;, &lt;a target="_blank" href="http://depblog.weblogs.us/"&gt;Glenn&lt;/a&gt; and myself.&lt;/p&gt;
&lt;p&gt;With a shared crowd of both Windows Phone developers, users and novices we opted to take a somewhat different approach by starting with the final result, and reversing back to how we did build the WiPhug app and what we tools we did use:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;MVVMLight&lt;/li&gt;
&lt;li&gt;Cimbalino&lt;/li&gt;
&lt;li&gt;AgFx&lt;/li&gt;
&lt;li&gt;Mtiks&lt;/li&gt;
&lt;li&gt;MS SQL Server CE&lt;/li&gt;
&lt;li&gt;Bing Maps / JeffWilcox.Maps&lt;/li&gt;
&lt;li&gt;Hubtile&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With a head count of approx. 45 listeners and all the great feedback we got, we can call this a great start for WiPhug. Future sessions will be announced on our site and through the WP7 app.&lt;/p&gt;
&lt;p&gt;Slides are available &lt;a target="_blank" href="http://www.slideshare.net/bartlannoeye/wi-phug-windows-phone-development-from-z-to-a"&gt;here&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Fri, 27 Apr 2012 16:15:00 GMT</pubDate><guid isPermaLink="true">http://www.bartlannoeye.be:80/blog/first-belgian-windows-phone-user-group-session</guid></item><item><title>Combining ResourceDictionary with MVVM Light or localization files</title><link>http://www.bartlannoeye.be:80/blog/combining-resourcedictionary-with-mvvm-light-or-localization-files</link><description>&lt;p&gt;I have several Windows Phone 7 apps up and running with both MVVM Light and localized resources without a problem. When I decided to take it a step further and try to add my custom ResourceDictionary reference in the App.xaml file, things blew up.&lt;/p&gt;
&lt;pre class="brush: xml;"&gt;&amp;lt;Application.Resources&amp;gt;
    &amp;lt;!--Global View Model Locator--&amp;gt;
    &amp;lt;vm:ViewModelLocator x:Key="Locator" d:IsDataSource="True" /&amp;gt;
    &amp;lt;localization:EvaResources x:Key="LocStrings" /&amp;gt;

    &amp;lt;ResourceDictionary&amp;gt;
        &amp;lt;ResourceDictionary.MergedDictionaries&amp;gt;
            &amp;lt;ResourceDictionary Source="Resources/EvaResourceDictionary.xaml"/&amp;gt;
        &amp;lt;/ResourceDictionary.MergedDictionaries&amp;gt;
    &amp;lt;/ResourceDictionary&amp;gt;
&amp;lt;/Application.Resources&amp;gt;&lt;/pre&gt;
&lt;p&gt;I&amp;rsquo;m getting the following error in Visual Studio 2010: &amp;ldquo;The type 'ResourceDictionary' is inside a ResourceDictionary and does not have a key.&amp;rdquo;, and Expression Blend 4 says: &amp;ldquo;Each dictionary entry must have an associated key.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;To solve it, you have to move both the MVVM Light Locator and localized resources references in their own ResourceDictionary and add this to the MergedDictionaries tag.&lt;/p&gt;
&lt;pre class="brush: xml; highlight: [6,7];"&gt;&amp;lt;Application.Resources&amp;gt;
    &amp;lt;ResourceDictionary&amp;gt;
        &amp;lt;ResourceDictionary.MergedDictionaries&amp;gt;
            &amp;lt;ResourceDictionary Source="Resources/EvaResourceDictionary.xaml"/&amp;gt;
            &amp;lt;ResourceDictionary&amp;gt;
                &amp;lt;vm:ViewModelLocator x:Key="Locator" d:IsDataSource="True" /&amp;gt;
                &amp;lt;localization:EvaResources x:Key="LocStrings" /&amp;gt;
            &amp;lt;/ResourceDictionary&amp;gt;
        &amp;lt;/ResourceDictionary.MergedDictionaries&amp;gt;
    &amp;lt;/ResourceDictionary&amp;gt;
&amp;lt;/Application.Resources&amp;gt;
&lt;/pre&gt;</description><pubDate>Sat, 21 Apr 2012 18:07:21 GMT</pubDate><guid isPermaLink="true">http://www.bartlannoeye.be:80/blog/combining-resourcedictionary-with-mvvm-light-or-localization-files</guid></item><item><title>Windows Phone SDK 7.1.1</title><link>http://www.bartlannoeye.be:80/blog/windows-phone-sdk-7.1.1</link><description>&lt;p&gt;Microsoft just released the final version of the &lt;a target="_blank" href="http://www.microsoft.com/download/en/details.aspx?id=29233"&gt;Windows Phone SDK 7.1.1&lt;/a&gt;. This version allows you to develop and test for the new 256 MB phone devices. You can run the 512-MB and 256-MB emulator side by side to compare functionality. Also good news is that this update allows you to develop for Windows Phone under the Windows 8 Customer Preview.&lt;/p&gt;</description><pubDate>Mon, 26 Mar 2012 18:10:05 GMT</pubDate><guid isPermaLink="true">http://www.bartlannoeye.be:80/blog/windows-phone-sdk-7.1.1</guid></item><item><title>The future of Windows Phone after Mango</title><link>http://www.bartlannoeye.be:80/blog/the-future-of-windows-phone-after-mango</link><description>&lt;p&gt;Last year in September Microsoft released a major update for the Windows Phone, version 7.5 or nicknamed Mango. The update brought us a long list of updates and new features. Next to that several new Windows Phone devices were announced and Nokia&amp;rsquo;s partnership with Microsoft brought the Lumia 710 and 800 devices to Belgium on February 1st. Up until now the Windows Phone was still quite unknown in Belgium for the general public, but this will probably change with the effort Nokia puts in advertisements. Next to gaining a large portion of the market share, we are also interested in what the future will bring for us, developers.&lt;/p&gt;
&lt;p&gt;Even though rumors are still rumors, it seems like we can expect 2 releases for Windows Phone in 2012. First of all there&amp;rsquo;s &amp;ldquo;Tango&amp;rdquo;, expected around mid-2012. This release is aimed at broadening the user base, by lowering the memory requirements to support lower-end (and thus cheaper) devices. These lower requirements will most likely also have effect on the apps we can create, limiting the memory use and resource-intensive tasks (and give more importance to cloud computing). A new SDK should be available around April to develop and test against this release. Other rumors are that Tango will support up to 120 languages (up from 35). With some luck we&amp;rsquo;ll get some things confirmed later this month at the Mobile World Congress.&lt;/p&gt;
&lt;p&gt;And then there is the video of Joe Belfiore to Nokia on Windows Phone 8, code-named Apollo that has been leaked. Windows Phone 8 is seen as part of the Windows 8 family of products and will share core technologies with its desktop- and tablet-based counterparts, including the kernel, multicore processor support, security and of course the Metro-style UI. Some of the experiences will be custom tailored for the smaller screen, including IE 10 Mobile version. It&amp;rsquo;s expected to hit the market together with Windows 8 by the end of the year.&lt;/p&gt;
&lt;p&gt;Other interesting features for Windows Phone 8 for the end customers include a NFC Chip enabling an integrated wallet experience, full micro SD support, camera improvements and custom &amp;ldquo;lens&amp;rdquo; apps and a Skype app. To get the most out of our limited data plans, we&amp;rsquo;ll get &amp;ldquo;Data Smart&amp;rdquo; in which the system will use Wi-Fi over cellular where possible, use less bandwidth and provide an app to manage data usage. Business users get complete BitLocker encryption out of the box, private app stores for businesses, a new version of Office mobile going together with the Office 15 wave, System Center integration and much more.&lt;/p&gt;
&lt;p&gt;For us developers, there are also a few interesting features like app-to-app communication based on Windows 8 Contracts and native C++ apps built on the Windows 8 kernel (out goes Windows CE), enabling to easily port Windows 8 or even Android/iOS apps to Windows Phone 8. This will certainly fuel the discussion "Is Silverlight dead?&amp;rdquo; again, but for now Windows Phone 8 should be backward compatible and support all current Mango apps, which could be around 100.000 of them by then.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s still early and everything is based on rumors and a leaked video, but Microsoft seems to continue the effort on increasing its market share for Windows Phone, both for individuals and businesses. Which in turn, might also bring new opportunities for us as Microsoft developers.&lt;/p&gt;</description><pubDate>Sun, 12 Feb 2012 19:47:18 GMT</pubDate><guid isPermaLink="true">http://www.bartlannoeye.be:80/blog/the-future-of-windows-phone-after-mango</guid></item><item><title>ArgumentOutOfRangeException on WP7 Reminder</title><link>http://www.bartlannoeye.be:80/blog/argumentoutofrangeexception-on-wp7-reminder</link><description>&lt;p&gt;During the creation of a Windows Phone 7 application for &lt;a href="http://www.trixonline.be/" target="_blank"&gt;Trix&lt;/a&gt; I wanted to give the user the chance to add a reminder for a concert of his choice. With some example code available, the implementation was smooth and easy. Until I ran into this error while testing the app:&lt;/p&gt;
&lt;pre&gt;ArgumentOutOfRangeException was unhandled
Specified argument was out of the range of valid values.
Parameter name: Title
&lt;/pre&gt;
&lt;p&gt;Since I selected an item with a very long title, it was quite clear what the problem was. A small search on &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.phone.scheduler.schedulednotification.title%28v=vs.92%29.aspx" target="_blank"&gt;MSDN&lt;/a&gt; learned me that the maximum length for this property is &lt;strong&gt;63 characters&lt;/strong&gt;.&lt;/p&gt;</description><pubDate>Sun, 15 Jan 2012 10:41:07 GMT</pubDate><guid isPermaLink="true">http://www.bartlannoeye.be:80/blog/argumentoutofrangeexception-on-wp7-reminder</guid></item><item><title>No matching constructor found for WP7 resources file</title><link>http://www.bartlannoeye.be:80/blog/no-matching-constructor-found-for-wp7-resources-file</link><description>&lt;p&gt;When I was adding localization to my first Windows Phone 7 app, I initially got following exception:&lt;/p&gt;
&lt;pre&gt;XamlParseException was unhandled
No matching constructor found on type 'MyApp.Resources.MyResources'. [Line: 15 Position: 34]

&lt;/pre&gt;
&lt;p&gt;with an InnerException:&lt;/p&gt;
&lt;pre&gt;MissingMethodException
   at System.Activator.InternalCreateInstance(Type type, Boolean nonPublic, StackCrawlMark&amp;amp; stackMark)
   at System.Activator.CreateInstance(Type type)
   at MS.Internal.XamlManagedRuntimeRPInvokes.CreateInstance(XamlTypeToken inXamlType, XamlQualifiedObject&amp;amp; newObject)
   at MS.Internal.XcpImports.Application_LoadComponentNative(IntPtr pContext, IntPtr pComponent, UInt32 cUriStringLength, String uriString, UInt32 cXamlStrLength, Byte* pXamlStr, UInt32 cAssemblyStrLength, String assemblyStr)
   at MS.Internal.XcpImports.Application_LoadComponent(IManagedPeerBase componentAsDO, String resourceLocator, UnmanagedMemoryStream stream, UInt32 numBytesToRead, String assemblyString)
   at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
   at MyApp.App.InitializeComponent()
   at MyApp.App..ctor()
   at System.Reflection.RuntimeConstructorInfo.InternalInvoke(RuntimeConstructorInfo rtci, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess, StackCrawlMark&amp;amp; stackMark)
   at System.Reflection.RuntimeConstructorInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, StackCrawlMark&amp;amp; stackMark)
   at System.Reflection.ConstructorInfo.Invoke(Object[] parameters)
   at MS.Internal.TypeProxy.&amp;lt;&amp;gt;c__DisplayClass30.&amp;lt;GetCreateObjectDelegate&amp;gt;b__2a()
   at MS.Internal.TypeProxy.CreateInstance(UInt32 customTypeId)
   at MS.Internal.FrameworkCallbacks.CreateKnownObject(IntPtr nativeRootPeer, UInt32 customTypeId, String initializationString, IntPtr&amp;amp; nativePeer, UInt32 isCreatedByParser)
   at MS.Internal.FrameworkCallbacks.CreateUnknownObject(String assemblyName, String typeName, IntPtr nativeRootPeer, String initializationString, UInt32&amp;amp; customTypeId, UInt32&amp;amp; coreTypeId, UInt32&amp;amp; typeFlags, IntPtr&amp;amp; nativePeer)
&lt;/pre&gt;
&lt;p&gt;If you break on all thrown CLR Exceptions, you'll get following error instead:&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="WP7ReminderTitleOutOfRange" alt="WP7MissingResourcesException" src="http://www.bartlannoeye.be/Media/Default/BlogPost/images/WP7MissingResourcesException.png" border="0" height="237" width="571" /&gt;&lt;/p&gt;
&lt;p&gt;The problem here is that the access modifier of resource files added to your WP7 project are &lt;strong&gt;internal&lt;/strong&gt; by default. Changing the access modifier in the designer, changes the class definition. However, the constructor stays internal. You can change the modifier manually in the xxResources.Designer.cs file. Just keep attention that it will return to internal when changing your resource file through the designer.&lt;/p&gt;
&lt;pre&gt;[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public class MyResources {
    
    private static global::System.Resources.ResourceManager resourceMan;
    
    private static global::System.Globalization.CultureInfo resourceCulture;
    
    [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
    public MyResources() {
}

&lt;/pre&gt;</description><pubDate>Wed, 04 Jan 2012 04:30:00 GMT</pubDate><guid isPermaLink="true">http://www.bartlannoeye.be:80/blog/no-matching-constructor-found-for-wp7-resources-file</guid></item><item><title>Moved from DasBlog to Orchard CMS</title><link>http://www.bartlannoeye.be:80/blog/moved-from-dasblog-to-orchard-cms</link><description>&lt;p&gt;As you can notice, I moved my blog from DasBlog to Orchard CMS. DasBlog has been stable (read no new development) for a few years now and although some effort has been put in upgrading it to .NET 4.0, it was far from done.&lt;/p&gt;
&lt;p&gt;There's still quite some work left to do like styling and finetuning. I had a new layout ready, but we all know Photoshop isn't HTML/CSS. Plus with the metro design gaining grounds, I decided to give the designer some extra work. However, the most important job is done: we're up and running and the old permalinks redirect to the new Orchard url structure.&lt;/p&gt;</description><pubDate>Fri, 30 Dec 2011 12:00:00 GMT</pubDate><guid isPermaLink="true">http://www.bartlannoeye.be:80/blog/moved-from-dasblog-to-orchard-cms</guid></item><item><title>How to force Mango on your WP7 device</title><link>http://www.bartlannoeye.be:80/blog/how-to-force-mango-on-your-wp7-device</link><description>&lt;p&gt;&lt;i&gt;Disclaimer: This is NOT an official installation guide for Mango (or any WP7 update) and is not supported by Microsoft. Using this process to upgrade is your own decision, any problems caused by this process are your own responsibility.&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;Today Microsoft released the news we've all been waiting for: &lt;a href="http://windowsteamblog.com/windows_phone/b/windowsphone/archive/2011/09/27/windows-phone-7-5-mango-update-begins.aspx" target="_blank"&gt;Mango updates are being rolled out&lt;/a&gt; !! However, like all previous updates, only a lucky few (10 percent) will get the update in the first week. If everything goes smoothly (remember the Samsung Omnia 7 problems with NoDo), this will be pulled up to 25% and after another 1 or 2 weeks to 100% of Windows Phone 7 customers.&lt;/p&gt;
&lt;p&gt;With the NoDo update I patiently waited for over 3 weeks, in vain. I know, I must have been mad to wait that long. But eventually, I got impatient and ended up &amp;ldquo;forcing&amp;rdquo; it upon my own device. Now with Mango, I sure won't wait several weeks for it, sorry Microsoft.&lt;/p&gt;
&lt;h2&gt;Now how to do it?&lt;/h2&gt;
&lt;p&gt;First check if you&amp;rsquo;re not getting the update pushed already, you can find this under Settings &amp;ndash;&amp;gt; Phone &amp;ndash;&amp;gt; Update. In my case I got the sad trombone: &amp;ldquo;Your phone is up to date&amp;rdquo; with 7392.&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="WP7UpToDate7392" alt="WP7UpToDate7392" src="http://www.bartlannoeye.be/Media/Default/BlogPost/images/WP7UpToDate7392.png" height="697" width="1016" border="0" /&gt;&lt;/p&gt;
&lt;p&gt;Repeat this last step to check for updates, but be ready to &lt;strong&gt;turn off your internet &lt;/strong&gt;(WLAN/Ethernet) after 1-5 seconds. The exact timing depends on the speed of your connection. With the NoDo update I needed about 3 seconds, for Mango I had to turn it off after 1 second already. If you happen to fail, just retry and change your timing a bit. I got it right on the 5th try and I say it&amp;rsquo;s well worth spending a few minutes on! When you get your timing right, you will normally get the update to 7403, which is an &amp;ldquo;in between&amp;rdquo; build just before Mango.&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="WP7UpdateAvailable7403" alt="WP7UpdateAvailable7403" src="http://www.bartlannoeye.be/Media/Default/BlogPost/images/WP7UpdateAvailable7403.png" height="697" width="1016" border="0" /&gt;&lt;/p&gt;
&lt;p&gt;From this point it&amp;rsquo;s quite straight forward. Turn your &lt;strong&gt;internet connection on&lt;/strong&gt; again and hit Update. Sit back and relax while update 7.0.7403.0 is getting installed.&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="WP7UpdateAvailable7403Install" alt="WP7UpdateAvailable7403Install" src="http://www.bartlannoeye.be/Media/Default/BlogPost/images/WP7UpdateAvailable7403Install.png" height="697" width="1016" border="0" /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And now the best news: once your phone did reboot after the installation, you should get the notification on the phone that a new update is available. Switching back to Zune I noticed Mango (7.10.7720.68) was downloading already!&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="WP7Installing7720" alt="WP7Installing7720" src="http://www.bartlannoeye.be/Media/Default/BlogPost/images/WP7Installing7720.png" height="686" width="834" border="0" /&gt;&lt;/p&gt;
&lt;p&gt;The whole process, including backups and both installations took about 40 minutes.&lt;/p&gt;</description><pubDate>Tue, 27 Sep 2011 20:45:00 GMT</pubDate><guid isPermaLink="true">http://www.bartlannoeye.be:80/blog/how-to-force-mango-on-your-wp7-device</guid></item><item><title>Deploying your site with SQL CE 4.0 to shared webhosting (Part 2)</title><link>http://www.bartlannoeye.be:80/blog/deploying-your-site-with-sql-ce-4.0-to-shared-webhosting-part-2</link><description>&lt;p&gt;In the previous post I described how to create your website with ASP.NET and SQL Server Compact 4 as database. The next step is to deploy your site. If you have a VPS or dedicated server, you got full access to it and normally shouldn&amp;rsquo;t run into any problems. But when you&amp;rsquo;re using shared webhosting, your actions are very limited. This post describes the errors you&amp;rsquo;ll most likely run into the first time you try this, and how to solve them.&lt;/p&gt;
&lt;p&gt;You can either deploy from within Visual Studio or FTP the files to your host. If you hit the URL to your website, you&amp;rsquo;ll most likely get following configuration error with the according web.config fragment below:&lt;br /&gt;&lt;b&gt;Parser Error Message: &lt;/b&gt;Could not load file or assembly 'System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.&lt;/p&gt;
&lt;pre class="xml" name="code"&gt;&amp;lt;compilation debug="true" targetFramework="4.0"&amp;gt;
  &amp;lt;assemblies&amp;gt;
    &amp;lt;add assembly="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/&amp;gt;
    &amp;lt;add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/&amp;gt;
    &amp;lt;add assembly="System.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/&amp;gt;&lt;/pre&gt;
&lt;p&gt;You get this error because most providers don&amp;rsquo;t have SQL CE 4.0 assemblies installed (yet?). This means you&amp;rsquo;ll have to 'bin deploy' the assemblies together with your site. Visual Studio 2010 provides a "Add Deployable Dependencies..." context menu item, which let you choose to add the required assemblies for Razor or SQL Server Compact to the Bin folder. (&lt;a href="http://blogs.msdn.com/b/webdevtools/archive/2011/01/06/how-to-bin-deploy-sql-compact-edition-4-0-and-razor-web-projects.aspx" target="_blank"&gt;picture source&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;img style="border-width: 0px; display: inline;" title="BindeployAddDependencies" alt="BindeployAddDependencies" src="http://www.bartlannoeye.be/Media/Default/BlogPost/images/BindeployAddDependencies.png" height="424" width="517" border="0" /&gt;&lt;/p&gt;
&lt;p&gt;With some 'luck' you hit the next error once you solved the problem above and refreshed the page:&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Parser Error Message: &lt;/b&gt;Access to the database file is not allowed. [ 1884,File name = somepath\App_Data\YourDatabase.sdf,SeCreateFile ]&lt;/p&gt;
&lt;p&gt;For this error you have to give &lt;strong&gt;read + write access&lt;/strong&gt; to the App_Data folder, usually done in the File Manager of your hosting control panel. If you got this error on your private server, check if the service running the Application Pool (e.g. Network Service) has these rights on the folder. You will also have to add following line of code (e.g. in the global.asax file):&lt;/p&gt;
&lt;pre class="c#" name="code"&gt;AppDomain.CurrentDomain.SetData("SQLServerCompactEditionUnderWebHosting", true);&lt;/pre&gt;
&lt;p&gt;This is because, by default, SQL CE blocks access when the connection is opened under the ASP.NET networking process. Once I ran through these steps, I got everything up and running without any hiccups.&lt;/p&gt;</description><pubDate>Tue, 12 Apr 2011 21:45:00 GMT</pubDate><guid isPermaLink="true">http://www.bartlannoeye.be:80/blog/deploying-your-site-with-sql-ce-4.0-to-shared-webhosting-part-2</guid></item><item><title>Use SQL CE 4 for your website (Part 1)</title><link>http://www.bartlannoeye.be:80/blog/use-sql-ce-4-for-your-website-part-1</link><description>&lt;p&gt;Why this post about SQL Compact Edition 4 (SQL CE 4)? In short it&amp;rsquo;s a &lt;strong&gt;free&lt;/strong&gt; database engine that doesn&amp;rsquo;t require an installation of a database server (SQL Server, MySQL, &amp;hellip;). Copy the SQL CE binaries in your /bin folder and you&amp;rsquo;re ready to go. You don&amp;rsquo;t need an administrator account and can even run it in medium trust environments, like a web host. Interested? This is what you need:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkId=209902" target="_blank"&gt;Visual Studio 2010 SP1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;SQL CE 4 Tools&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Note: around MIX 11 the link for the tools broke down. It is still available in the Web Platform Installer (WebPI) v3.&lt;/p&gt;
&lt;p&gt;&lt;img style="border: 0px none; display: inline;" title="WebPI3SQLCE4" alt="WebPI3SQLCE4" src="http://www.bartlannoeye.be/Media/Default/BlogPost/images/WebPI3SQLCE4.png" height="544" width="784" border="0" /&gt;&lt;/p&gt;
&lt;h2&gt;New project&lt;/h2&gt;
&lt;p&gt;We get started with a standard ASP.NET 4.0 Web Application. Right-click on the App_Data folder and select &amp;ldquo;Add-&amp;gt;New Item&amp;rdquo;. On top of the &amp;ldquo;Add item&amp;rdquo; dialog box, you&amp;rsquo;ll find the option to create a &amp;ldquo;SQL Server Compact 4.0 Local Database&amp;rdquo;, with .sdf as extension. On adding the database, all references for SQL CE get added automatically.&lt;/p&gt;
&lt;p&gt;&lt;img style="border: 0px none; display: inline;" title="SQLCENewDatabase" alt="SQLCENewDatabase" src="http://www.bartlannoeye.be/Media/Default/BlogPost/images/SQLCENewDatabase.png" height="286" width="959" border="0" /&gt;&lt;/p&gt;
&lt;p&gt;I could continue writing every single step of the process to get your site building, but maybe even better is checking out ScottGu&amp;rsquo;s very detailed guide on &lt;a href="http://weblogs.asp.net/scottgu/archive/2011/01/11/vs-2010-sp1-and-sql-ce.aspx" target="_blank"&gt;creating the database and building your ASP.NET site with SQL CE&lt;/a&gt; and Entity Framework 4.&lt;/p&gt;
&lt;p&gt;Interesting note: if you want to use a regular LINQ datacontext with your SQL CE database, have a look at this &lt;a href="http://www.codeproject.com/KB/linq/Compact_LINQ.aspx" target="_blank"&gt;Compact LINQ codeproject&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;ASP.NET Membership&lt;/h2&gt;
&lt;p&gt;Now next up is authentication on your site. If you opt for Forms Authentication, you have the problem that ASP.NET Membership uses the full version of SQL Server (Express). Luckily Erik Ejlskov Jensen wrote a &lt;a href="http://erikej.blogspot.com/2010/08/sql-server-compact-40-aspnet-membership.html" target="_blank"&gt;SQL CE 4 ASP.NET Membership provider&lt;/a&gt; that is hosted on &lt;a href="http://sqlcemembership.codeplex.com/" target="_blank"&gt;CodePlex&lt;/a&gt;. Add the 3 code files or the assembly to your project, change your web.config file as specified on the project site and run your site. The membership database gets created automatically. Can&amp;rsquo;t be much easier, can it?&lt;/p&gt;
&lt;p&gt;In &lt;a href="http://www.bartlannoeye.be/blog/deploying-your-site-with-sql-ce-4.0-to-shared-webhosting-part-2"&gt;part 2&lt;/a&gt; we&amp;rsquo;ll deploy to shared hosting.&lt;/p&gt;</description><pubDate>Tue, 12 Apr 2011 20:00:00 GMT</pubDate><guid isPermaLink="true">http://www.bartlannoeye.be:80/blog/use-sql-ce-4-for-your-website-part-1</guid></item><item><title>Take your notes everywhere</title><link>http://www.bartlannoeye.be:80/blog/take-your-notes-everywhere</link><description>&lt;p&gt;The days when you only had one computer to store and edit your files on are long gone. Nowadays people have multiple systems (desktop, laptop), mobile devices (smartphone, tablet) and work at home, the office or the client. And it&amp;rsquo;s more than normal to have your documents, worksheets and notes available everywhere. There are several possibilities to make this possible like &lt;a title="Google Docs" href="http://docs.google.com/" target="_blank"&gt;Google Docs&lt;/a&gt;, &lt;a title="Dropbox" href="http://www.dropbox.com/" target="_blank"&gt;Dropbox&lt;/a&gt;, &lt;a title="SugarSync" href="https://www.sugarsync.com/" target="_blank"&gt;SugarSync&lt;/a&gt;, &amp;hellip;&lt;/p&gt;
&lt;p&gt;I use or have used most of them, but today I&amp;rsquo;ll write about &lt;a title="Windows Live Skydrive" href="http://explore.live.com/windows-live-skydrive" target="_blank"&gt;Windows Live SkyDrive&lt;/a&gt;. It&amp;rsquo;s been around for years already and gives you 25GB of free storage in the cloud. But now it integrates with Windows Phone 7 and &lt;a href="http://office.microsoft.com/en-us/web-apps/" target="_blank"&gt;Office Web Apps&lt;/a&gt;, either directly on &lt;a href="http://skydrive.live.com"&gt;http://skydrive.live.com&lt;/a&gt; or via &lt;a title="http://office.live.com/" href="http://office.live.com/"&gt;http://office.live.com/&lt;/a&gt;, which enable you to open and edit your documents in the browser. I really like this feature because unlike with Office 2010, not all versions in Office 2007 (and lower) have OneNote included.&lt;/p&gt;
&lt;h2&gt;Windows Phone 7&lt;/h2&gt;
&lt;p&gt;If you own a WP7 device, or have been following the news on these devices, you&amp;rsquo;ve most likely seen how the &lt;a href="http://www.microsoft.com/windowsphone/en-us/features/default.aspx#office-hub" target="_blank"&gt;Office Hub&lt;/a&gt; on Windows Phone 7 works. It didn&amp;rsquo;t take long before I opened up OneNote on my phone and started entering some notes. The document gets automatically saved to your device, but for synchronisation with the cloud, for WP7 that&amp;rsquo;s SkyDrive, you&amp;rsquo;ll need do so some extra work next to turn on &amp;ldquo;Automatic synchronisation&amp;rdquo; in the settings. The &lt;strong&gt;first time&lt;/strong&gt; you have to run through these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Flick to OneNote in the Office hub.&lt;/li&gt;
&lt;li&gt;Tap &amp;ldquo;All&amp;rdquo; and then tap &amp;ldquo;Refresh&amp;rdquo;.&lt;/li&gt;
&lt;li&gt;Tap &amp;ldquo;Yes&amp;rdquo; in the &amp;ldquo;Sync with SkyDrive?&amp;rdquo; message box.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This will sign you in with your Windows Live ID and create a notebook named Personal (Web) in your &amp;ldquo;My Documents&amp;rdquo; folder and might take a few moments. Once set up, you can either refresh manually or opt for auto-sync under the settings. On the picture below you see that a folder &amp;ldquo;My Documents&amp;rdquo; is created and contains my notebook. You also notice my pictures that get synched down from the phone.&lt;/p&gt;
&lt;p&gt;&lt;img style="border-width: 0px; display: inline;" title="SkyDriveWP7Sync" alt="SkyDriveWP7Sync" src="http://www.bartlannoeye.be/Media/Default/BlogPost/images/SkyDriveWP7Sync.png" height="519" width="605" border="0" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;h2&gt;Office Web Apps&lt;/h2&gt;
&lt;p&gt;If you hover over the file in your browser you get several actions like &amp;ldquo;Edit in browser&amp;rdquo; and &amp;ldquo;Open in OneNote&amp;rdquo;. The first opens your OneNote file in your browser for editing, while the second action launches your installed OneNote application. If you got both open, you&amp;rsquo;ll notice that changes in one place get synched within a few seconds time.&lt;/p&gt;
&lt;p&gt;&lt;img style="border-width: 0px; display: inline;" title="SkyDriveOfficeWebApps" alt="SkyDriveOfficeWebApps" src="http://www.bartlannoeye.be/Media/Default/BlogPost/images/SkyDriveOfficeWebApps.png" height="116" width="639" border="0" /&gt;&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re the only editor and aren&amp;rsquo;t planning to share with anyone else, it might be handy to turn off the &amp;ldquo;Show Authors&amp;rdquo; under the &amp;ldquo;View&amp;rdquo; ribbon in the browser. In OneNote 2010 you find the same functionality under &amp;ldquo;Share&amp;rdquo; &amp;ndash;&amp;gt; &amp;ldquo;Hide Authors&amp;rdquo;. This hide the overview of all authors in the editor pane.&lt;/p&gt;
&lt;p&gt;&lt;img style="border-width: 0px; display: inline;" title="OneNoteHideAuthors" alt="OneNoteHideAuthors" src="http://www.bartlannoeye.be/Media/Default/BlogPost/images/OneNoteHideAuthors.png" height="137" width="573" border="0" /&gt;&lt;/p&gt;
&lt;h2&gt;OneNote 2010&lt;/h2&gt;
&lt;p&gt;You can either open an existing OneNote notebook from the Office Live website or start from scratch. If you create a new notebook in OneNote 2010, you&amp;rsquo;ll see that the default store location is the web. This location is your Offive Live/SkyDrive folder. A very detailed step-by-step walkthrough is available on &lt;a href="http://www.howtogeek.com/howto/21406/sync-onenote-2010-notebooks-to-office-live-and-edit-them-anywhere/" target="_blank"&gt;How-to Geek&lt;/a&gt; (source of the picture below).&lt;/p&gt;
&lt;p&gt;&lt;img style="border-width: 0px; display: inline;" title="OneNoteSaveToWeb" alt="OneNoteSaveToWeb" src="http://www.bartlannoeye.be/Media/Default/BlogPost/images/OneNoteSaveToWeb.png" height="357" width="487" border="0" /&gt;&lt;/p&gt;</description><pubDate>Tue, 05 Apr 2011 19:00:00 GMT</pubDate><guid isPermaLink="true">http://www.bartlannoeye.be:80/blog/take-your-notes-everywhere</guid></item><item><title>AvePoint DocAve generating SQL login errors</title><link>http://www.bartlannoeye.be:80/blog/avepoint-docave-generating-sql-login-errors</link><description>&lt;p&gt;When logging in on a MOSS 2007 WFE-server to investigate a smaller issue, I noticed a wall of red errors in the event viewer. Most of them came down to something like:&lt;/p&gt;
&lt;pre class="none" name="code"&gt;Event Type:    Error&lt;br /&gt;Event Source:    Windows SharePoint Services 3&lt;br /&gt;Event Category:    Database &lt;br /&gt;Event ID:    1111&lt;br /&gt;Date:        dd/mm/yyyy&lt;br /&gt;Time:        1:00:00&lt;br /&gt;User:        N/A&lt;br /&gt;Computer:    SERVERNAME&lt;br /&gt;Description:&lt;br /&gt;SQL database login failed. Additional error information from SQL Server is included below.&lt;br /&gt;&lt;br /&gt;Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.&lt;br /&gt;&lt;br /&gt;For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.&lt;/pre&gt;
&lt;p&gt;It was pretty clear that some SQL credentials weren't correct, I just had to find out which ones. These are (part of) the errors I found in the SharePoint ULS logs:&lt;/p&gt;
&lt;pre class="none" name="code"&gt;DocAveAPVCService.exe (0x052C)   0x0D20    Windows SharePoint Services       Database     880i    High&lt;br /&gt;        System.Data.SqlClient.SqlException: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. &lt;br /&gt;DocAveAPVCService.exe (0x052C)   0x0D20    Windows SharePoint Services       Database     880j    High&lt;br /&gt;        SqlError: 'Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.'&lt;br /&gt;DocAveAPVCService.exe (0x052C)   0x0D20    Windows SharePoint Services       Database     6y64    Critical&lt;br /&gt;        SQL database login failed. Additional error information from SQL Server is included below.&lt;br /&gt;        Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.&lt;/pre&gt;
&lt;p&gt;A quick visit to the services control panel taught me that &amp;ldquo;AvePoint Communication Service&amp;rdquo; was running under the Local System credentials. This explains the failed login with 'NT AUTHORITY\ANONYMOUS LOGON' credentials in SQL Server on a different machine.&lt;/p&gt;
&lt;h2&gt;Solution&lt;/h2&gt;
&lt;p&gt;The solution is simple: run &amp;ldquo;AvePoint Communication Service&amp;rdquo; under (domain) credentials that have access to the SQL Server instance.&lt;/p&gt;
&lt;p&gt;Edit: AvePoint seems to have a private patch available for this issue which you can receive after contacting them.&lt;/p&gt;</description><pubDate>Fri, 11 Mar 2011 11:15:00 GMT</pubDate><guid isPermaLink="true">http://www.bartlannoeye.be:80/blog/avepoint-docave-generating-sql-login-errors</guid></item></channel></rss>