DEP0700 : Registration of the app failed. Rejecting a request to register from because the files are on a network share.

I wanted to run my app an my VM, but got the above error…

A quick search on google lead me to this thread on DevCenter: http://social.msdn.microsoft.com/Forums/en-US/winappswithhtml5/thread/3fc1f3cf-2d8b-4dee-a348-40d0bf2c3c66/

The answer there is spot on!

I chose option 1, setting my debug option to Remote and setting by Debug option to localhost. Works like a charm! Thanks Gearard Boland for providing us with the answer!

Happy coding!

 

PS. Malavikas comment made me create this image:

Installing Win8 in VHD for use with Virtualbox using install.WIM

I found this wonderful solution for installing Windows 8 on a VHD for dual-boot using the imagex tool. You can read about it here: http://blogs.technet.com/b/haroldwong/archive/2012/08/18/how-to-create-windows-8-vhd-for-boot-to-vhd-using-simple-easy-to-follow-steps.aspx

Problem I experienced now was that I needed a VitualBox Windows 8 machine and there it did not work. I got the message ‘BOOT FAILURE’ after trying to start up that installation.

I ended up using WIM2VHD with the /HyperV switch to prep the VHD for Hyper-V. Then I created a new VirtualBox machine with the vhd. I removed the SATA controller entirely and added new IDE harddisk using the vhd.

And now I am running Windows 8 in VirtualBox!

 

Happy coding!

In the Pocket – Users

I got a mail today, from a user … yes, really… A real user! He likes my app. And I like him for using it! I aim to please.

He had 2 feature requests. I love that sort of thing. Yesterday I didn’t really know what to do when sitting behind my pc. I wanted to continue working on In the Pocket, but I lacked a sense of purpose. And now I have no less than 2 features to build.

After nearly 100 downloads, I decided to create a uservoice site for In the Pocket. Dennis (http://bloggingabout.net/blogs/dennis) suggested it. This was just what I needed, a way to know what to do next!

So if you have a suggestion for In the Pocket: please register it at http://inthepocket.uservoice.com or go there to vote for the next features to build.

If you found a bug or have some other issue with it, send an email to tickets@inthepocket.uservoice.com.

Now that I know what to do, let’s get back to some happy coding!

In The Pocket – Open work list

I decided to make my Trello work list for In The Pocket public, but read-only. You can follow the progress of In The Pocket here:

https://trello.com/board/in-the-pocket/50dcd3b6b3ac9e631b000707

Windows 8 – Html to RichTextBox Content

As I explained in my last posts (here and here) I want to use Diffbot to implement my offline reading feature. I want the text to show up looking as close to the real website as I can. This can be done with the RichTextBlock control. This can implement a very limited set of xaml elements. Read about it on http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.richtextblock.

Luckily DiffBot can send me the text in html, so the style isn’t lost. All I needed is a way to convert Html to Xaml. If you search NuGet for ‘RichTextBlock’ you get 2 results: RichTextBlock.Html2Xaml and WinRT Html2Xaml Converter . I tried them both, but the first uses an xslt template for parsing the html and that only works if the html can be processed as xml. If only every website was this tidy… So I ended up using the last one that uses HtmlAgilityPack to parse the html.

WinRT.Html2Xaml

I like the general idea of this project. Check out the code on https://winrthtml2xaml.codeplex.com/. Here’s how it works:

There is an attached property for the Html so we can bind a string in a class called Properties. Whenever the Html changes the HtmlChanged eventhandler is called. This method uses the converter to convert html to xaml, set this in a new RichTextBlock and then moves all the blocks from the new RichTextBlock into the existing one. Works like a charm.

The Html2XamlConverter is a static class with 1 public method: Convert2Xaml(string htmlString) (it also has an overload where you can specify extra attributes) which is called from the HtmlChanged eventHandler. It uses TagDefinitions to specify how a translation between html and xaml tags should be made.

Downside

Unfortunately, this package does not support parsing img tags to Images and it provided no good way of extending the processing to my needs. The Html2XamlConverter is a static class with a fixed set of TagDefinitions, there is no way to get in between.

Nothing to do but fork I guess.

Fixing extensibility

First of all, to allow dependency the static Html2XamlConverter must be changed to a non-static class. Secondly, I added an extra attached property Converter in the Properties class to allow setting converter in xaml (this has to be a resource though. Here’s how you use it:

<Page.Resources>

        <common:MyHtml2XamlConverter x:Key=”MyConverter” />

    </Page.Resources>


<RichTextBlock

h2xaml:Properties.Html=”{Binding Text}”

h2xaml:Properties.Converter=”{StaticResource MyConverter}” />

I can now specify which Converter I want to use. I can even bind it if I so want.

So I forked the code, refactored and will do a pull request soon. In the meanwhile get the code here: http://winrthtml2xaml.codeplex.com/SourceControl/network/forks/dmarckmann/extendableHtml2Xaml

Accidentally, I added support for img tag parsing also.

Here’s a little sample of a converter that will parse pre tags to allow the right view of c# code:

public
class
MyHtml2XamlConverter : Html2XamlConverter

    {

        public MyHtml2XamlConverter()

            : base()

        {

            tags.Add(“pre”, new
TagDefinition(parsePre) { MustBeTop = true });

        }

        private
void parsePre(StringBuilder xamlString, HtmlNode node, bool isTop)

        {

            xamlString.Append(“<Span FontFamily=”Consolas” FontSize=”14″>”);

            xamlString.Append(node.InnerText.Replace(“n”, “<LineBreak/>”).Replace(” “, “<Run Text=” “/>”));

            xamlString.Append(“</Span>”);

        }

    }

Now we’ll have to wait for someone to make us a converter that will parse pre tags with c# color coding… (Do I hear ‘challenge accepted!’? Anyone?)

Happy coding!

In the Pocket – Using DiffBot

In order to be able to read content offline, I decided to implement DiffBot rather than apply for use of the Article View API of Pocket itself.

DiffBot is just awesome. It is so accurate in picking the main content. Pocket Article View API is sometimes just plain wrong. Look at Udi Dahans blog for example:


This is what Pocket makes of it:


That is not the main content at all, it is the sidebar! DiffBot however, is absolutely spot on:


Basically this is because DiffBot approaches the webpages visually. It ‘looks’ at pages the way humans do.

And they have more than just the article API! Learn more on how DiffBot works and what it can do for you:

And DiffBot is also really easy to implement: just check out the API documentation here. You can also take it for a spin there!

Happy coding!

Status update for In the Pocket

I am still working on my app In the Pocket, but my focus is now on getting my paid version out.

The paid version of In The Pocket (release 1) will add the following features to In The Pocket Free:

  • Being able to save articles locally (implemented using DiffBot service)
  • Queuing added items even when you have no internet
  • Marking items as read even when you have no internet
  • Being able to mark many items as read from the main screen
  • Being able to read items that have been archived (Marked as read)

You may wander, why I want to have all these offline features. The reason is simple and I will explain below.

Although the moments are scarce, we are still not always connected to the internet with our tablet or laptop. When we are on the move, we have a phone that is still connected, our other devices are usually not. You can set up Connection sharing to have a wifi connection always, but your data plan would have to be a big one and your bill will be huge. For most people this is not an option.

So better to plan for an ‘occasionally connected’ application, but that means you will have to have all the features available that you would have when you are online.

Windows 8 RT & Caliburn.Micro – Being a share source

If you want to know how to share be a share target rather than the source, go here.

Being is the source of the share action is simple.

In the ViewModel where you have the content you want to share, add this:

protected
override
void OnActivate()

{


base.OnActivate();


DataTransferManager.GetForCurrentView().DataRequested += OnDataRequested;

}


protected
override
void OnDeactivate(bool close)

{


base.OnDeactivate(close);


DataTransferManager.GetForCurrentView().DataRequested -= OnDataRequested;

}


protected
void OnDataRequested(DataTransferManager sender, DataRequestedEventArgs args)

{


var request = args.Request;


var requestData = request.Data;

requestData.Properties.Title = Title;

requestData.Properties.Description = Description;

requestData.SetUri(new
Uri(Url));

}

Basically, we subscribe to the DataRequested event and fill the Request that comes with the event arguments with the data we want to share.

Easy!

In The Pocket Privacy Policy

Privacy Policy

I recognize that your privacy is important to you.

What information does the app collect?

In the Pocket and In The Pocket Free do not collect, store, or share any of your personal information. It also does not collect any data, information, trends, or track user movements.

Do we disclose any information to outside parties?

The app does not store, sell, trade, or otherwise transfer to outside parties any information. The app allows you to open web URLs from the application.
The URLs might be saved by internet browsers on your device. For information regarding the information stored by third party services, please read the privacy policy of the internet browsers on your device.

Windows 8 – NuGet: You are trying to install this package into a project that targets ‘.NETCore,Version=v4.5’

Today, after installing Visual Studio Express 2012 for Windows 8 on my home laptop, I experienced something I haven’t since I started developing. I got this message when trying to install Caliburn.Micro in a new project:

You are trying to install this package into a project that targets ‘.NETCore,Version=v4.5’, but the package does not contain any assembly references that are compatible with that framework. For more information, contact the package author.

I remember having to Google for a while before finding the answer, so here it is: It’s to do with the version of NuGet Package Manager you have installed. NuGet 2.0 or earlier expect the ‘winRT45′ or ‘NETCore45’ packages while as of version 2.1 NuGet expects one of the following: Windows, Windows8, win, win8.

More information can be found here: http://docs.nuget.org/docs/release-notes/nuget-2.1#Targeting_Windows_8_and_Windows_Phone_8_Projects