Localhost connection fails in Unit Test Project

Windows 8 Store apps are not allowed to connect to localhost using any network connection type like a simple http request. For developers Visual Studio 2012 automatically exempts your Windows Store App projects by putting them into the right isolation level, but for your Unit Test projects Visual Studio does not do the same. So, to connect to localhost – or just if you are using Fiddler – in your Unit Test project , you have to manually put them in to the “exception list”.

Open a command line window and check, if your Unit Test project is in the correct isolation level.

CheckNetIsolation Loopbackexempt -s

Add your Unit Test project to the list

CheckNetIsolation Loopbackexempt -a -n=<package familiy name>

You can find your “package familiy name” in the “package.appmanifest” file of your Unit Test project in the Packaging tab.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: